Pull request
# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmNXleQSHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748TIsP/1gulTFpYAs3Kao6IZonsuCzrjQrJWqv
# 5SD7cVb7isOWdOSNK3glE4dG54Q38PaS9GHaCvzIndjHxlWddCCUuwiw6p1Wdo70
# fjNfcCOEPoalQbkZvLejhs5n2rlfTvS5JUnLKVD9+ton7hjnTyKGDDYao5mYhtzv
# Kn9NpCD3m+K3orzG2Jj7jR1UAumg4cW4YQEpT8ItDT4Y5UAxjL6TZQ6CE220DQDq
# YwDrHEgDYr/UKlTbIC/JwlKOLr0sh+UB1VV8GZS6e6pU9u5WpDDHlQZpU8W2tLLg
# cG5m8tLG2avFxRMUFrPNZ8Lx2xKO8wL1PtgAO9w7qFK+r0soZvv+Zh4ev/t5zGLf
# ciliItqf97yPYNIc3su75jqdQHed7lmZc3m9LBHg8VXN6rAatt8vWUbG90sAZuTU
# tWBZHvQmG0s2MK4UYqeQ59tc21v9T2+VCiiv/1vjgEUr8tBhXS562jrDt/bNEqKa
# eRzT4h4ffbP6BJRnyakxkFkQ7nd2OdlLNKUAr9Tk6T2fYuarfEdbYx//0950agqD
# AAtdQ/AJm6Pq1Px0/RuMKK5WsL818BoAkfr6n7qXleunytJ1W5hjW9EmFIPZWPTR
# ce/lSFHA0+MCpg6C8zAa4iNBg/Pk0p3GRrTeWyHK1FjV+Gep1QtE/a1vk/qiPzTM
# qZVfPxa8cXXe
# =caiq
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 25 Oct 2022 03:53:08 EDT
# gpg: using RSA key
CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg: issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C
* tag 'trivial-branch-for-7.2-pull-request' of https://gitlab.com/laurent_vivier/qemu:
accel/tcg/tcg-accel-ops-rr: fix trivial typo
ui: remove useless typecasts
treewide: Remove the unnecessary space before semicolon
include/hw/scsi/scsi.h: Remove unused scsi_legacy_handle_cmdline() prototype
vmstate-static-checker:remove this redundant return
tests/qtest: vhost-user-test: Fix [-Werror=format-overflow=] build warning
tests/qtest: migration-test: Fix [-Werror=format-overflow=] build warning
Drop useless casts from g_malloc() & friends to pointer
elf2dmp: free memory in failure
hw/core: Tidy up unnecessary casting away of const
.gitignore: add multiple items to .gitignore
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
/GNUmakefile
/build/
/.cache/
+/.vscode/
*.pyc
.sdk
.stgit-*
.git-submodule-status
+.clang-format
+.gdb_history
cscope.*
tags
TAGS
*
* The kick timer is responsible for moving single threaded vCPU
* emulation on to the next vCPU. If more than one vCPU is running a
- * timer event with force a cpu->exit so the next vCPU can get
+ * timer event we force a cpu->exit so the next vCPU can get
* scheduled.
*
* The timer is removed if all vCPUs are idle and restarted again once
if (va_space_rw(vs, KdDebuggerDataBlock, kdbg, kdbg_hdr.Size, 0)) {
eprintf("Failed to extract entire KDBG\n");
+ free(kdbg);
return NULL;
}
err = pdu_unmarshal(pdu, offset, "ddw", &fid, &newfid, &nwnames);
if (err < 0) {
pdu_complete(pdu, err);
- return ;
+ return;
}
offset += err;
static void *mipid_init(void)
{
- struct mipid_s *s = (struct mipid_s *) g_malloc0(sizeof(*s));
+ struct mipid_s *s = g_malloc0(sizeof(*s));
s->id = 0x838f03;
mipid_reset(s);
static void n8x0_init(MachineState *machine,
struct arm_boot_info *binfo, int model)
{
- struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s));
+ struct n800_s *s = g_malloc0(sizeof(*s));
MachineClass *mc = MACHINE_GET_CLASS(machine);
if (machine->ram_size != mc->default_ram_size) {
g_free(q->data);
q->data = NULL;
- q->data = (uint8_t *)g_malloc0(q->size);
+ q->data = g_malloc0(q->size);
q->sp = 0;
q->rp = 0;
void *guest_fdt = data->fdt, *host_fdt;
const void *r;
int i, prop_len;
- uint32_t *irq_attr, *reg_attr, *host_clock_phandles;
+ uint32_t *irq_attr, *reg_attr;
+ const uint32_t *host_clock_phandles;
uint64_t mmio_base, irq_number;
uint32_t guest_clock_phandles[2];
error_report("%s clocks property should contain 2 handles", __func__);
exit(1);
}
- host_clock_phandles = (uint32_t *)r;
+ host_clock_phandles = r;
guest_clock_phandles[0] = qemu_fdt_alloc_phandle(guest_fdt);
guest_clock_phandles[1] = qemu_fdt_alloc_phandle(guest_fdt);
void *s1d13745_init(qemu_irq gpio_int)
{
- BlizzardState *s = (BlizzardState *) g_malloc0(sizeof(*s));
+ BlizzardState *s = g_malloc0(sizeof(*s));
DisplaySurface *surface;
s->fb = g_malloc(0x180000);
}
if (!insn) {
pl330_fault(ch, PL330_FAULT_UNDEF_INSTR | PL330_FAULT_DBG_INSTR);
- return ;
+ return;
}
ch->stall = 0;
insn->exec(ch, opcode, args, insn->size - 1);
CBus *cbus_init(qemu_irq dat)
{
- CBusPriv *s = (CBusPriv *) g_malloc0(sizeof(*s));
+ CBusPriv *s = g_malloc0(sizeof(*s));
s->dat_out = dat;
s->cbus.clk = qemu_allocate_irq(cbus_clk, s, 0);
void *retu_init(qemu_irq irq, int vilma)
{
- CBusRetu *s = (CBusRetu *) g_malloc0(sizeof(*s));
+ CBusRetu *s = g_malloc0(sizeof(*s));
s->irq = irq;
s->irqen = 0xffff;
void *tahvo_init(qemu_irq irq, int betty)
{
- CBusTahvo *s = (CBusTahvo *) g_malloc0(sizeof(*s));
+ CBusTahvo *s = g_malloc0(sizeof(*s));
s->irq = irq;
s->irqen = 0xffff;
(unsigned long long)val, (unsigned int)addr);
if (addr > CAN_SJA_MEM_SIZE) {
- return ;
+ return;
}
if (s->clock & 0x80) { /* PeliCAN Mode */
addrbits = 6;
}
- eeprom = (eeprom_t *)g_malloc0(sizeof(*eeprom) + nwords * 2);
+ eeprom = g_malloc0(sizeof(*eeprom) + nwords * 2);
eeprom->size = nwords;
eeprom->addrbits = addrbits;
/* Output DO is tristate, read results in 1. */
if ((cmt->cmstr & (1 << ch)) == 0) {
/* count disable, so not happened next event. */
- return ;
+ return;
}
next_time = cmt->cmcor[ch] - cmt->cmcnt[ch];
next_time *= NANOSECONDS_PER_SECOND;
int i, event;
if (tmr->tccr[ch] == 0) {
- return ;
+ return;
}
if (FIELD_EX8(tmr->tccr[ch], TCCR, CSS) == 0) {
/* external clock mode */
/* event not happened */
- return ;
+ return;
}
if (FIELD_EX8(tmr->tccr[0], TCCR, CSS) == CSS_CASCADING) {
/* cascading mode */
if (ch == 1) {
tmr->next[ch] = none;
- return ;
+ return;
}
diff[cmia] = concat_reg(tmr->tcora) - concat_reg(tmr->tcnt);
diff[cmib] = concat_reg(tmr->tcorb) - concat_reg(tmr->tcnt);
tmr->tcorb[ch]) & 0xff;
} else {
if (ch == 1) {
- return ;
+ return;
}
tcnt = issue_event(tmr, ch, 16,
concat_reg(tmr->tcnt),
const uint8_t *apdu, uint32_t len)
{
EmulatedState *card = EMULATED_CCID_CARD(base);
- EmulEvent *event = (EmulEvent *)g_malloc(sizeof(EmulEvent) + len);
+ EmulEvent *event = g_malloc(sizeof(EmulEvent) + len);
assert(event);
event->p.data.type = EMUL_GUEST_APDU;
if (virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) {
error_setg(errp, "VIRTIO_F_IOMMU_PLATFORM was supported by"
" neither legacy nor transitional device");
- return ;
+ return;
}
/*
* Legacy and transitional devices use specific subsystem IDs.
shdr_table = load_at(fd, ehdr->e_shoff,
sizeof(struct elf_shdr) * ehdr->e_shnum);
if (!shdr_table) {
- return ;
+ return;
}
if (must_swab) {
const char *serial, Error **errp);
void scsi_bus_set_ua(SCSIBus *bus, SCSISense sense);
void scsi_bus_legacy_handle_cmdline(SCSIBus *bus);
-void scsi_legacy_handle_cmdline(void);
SCSIRequest *scsi_req_alloc(const SCSIReqOps *reqops, SCSIDevice *d,
uint32_t tag, uint32_t lun, void *hba_private);
if s["Name"] != d["Name"]:
print("Warning: checking incompatible machine types:", end=' ')
print("\"" + s["Name"] + "\", \"" + d["Name"] + "\"")
- return
def main():
}
assert(msr_list.nmsrs > 0);
- kvm_feature_msrs = (struct kvm_msr_list *) \
- g_malloc0(sizeof(msr_list) +
+ kvm_feature_msrs = g_malloc0(sizeof(msr_list) +
msr_list.nmsrs * sizeof(msr_list.indices[0]));
kvm_feature_msrs->nmsrs = msr_list.nmsrs;
(breakpoints->breakpoints ? breakpoints->breakpoints->used : 0);
struct whpx_breakpoint_collection *new_breakpoints =
- (struct whpx_breakpoint_collection *)g_malloc0(
- sizeof(struct whpx_breakpoint_collection) +
- max_breakpoints * sizeof(struct whpx_breakpoint));
+ g_malloc0(sizeof(struct whpx_breakpoint_collection)
+ + max_breakpoints * sizeof(struct whpx_breakpoint));
new_breakpoints->allocated = max_breakpoints;
new_breakpoints->used = 0;
return;
}
if (tot - cnt == 0) {
- return ;
+ return;
}
memset(base + cnt, -1, tot - cnt);
}
uint32_t tmp;
tcg_debug_assert(sz < 3);
if (env->regs[3] == 0) {
- return ;
+ return;
}
do {
tmp = cpu_ldufn[sz](env, env->regs[1], GETPC());
uint32_t tmp;
tcg_debug_assert(sz < 3);
if (env->regs[3] == 0) {
- return ;
+ return;
}
do {
tmp = cpu_ldufn[sz](env, env->regs[1], GETPC());
}
size = nb_hw_breakpoints * sizeof(struct kvm_hw_breakpoint);
hw_breakpoints =
- (struct kvm_hw_breakpoint *)g_realloc(hw_breakpoints, size);
+ g_realloc(hw_breakpoints, size);
} else {
g_free(hw_breakpoints);
hw_breakpoints = NULL;
tmpfs = g_dir_make_tmp("migration-test-XXXXXX", &err);
if (!tmpfs) {
- g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs,
- err->message);
+ g_test_message("Can't create temporary directory in %s: %s",
+ g_get_tmp_dir(), err->message);
}
g_assert(tmpfs);
tmpfs = g_dir_make_tmp("vhost-test-XXXXXX", &err);
if (!tmpfs) {
- g_test_message("g_dir_make_tmp on path (%s): %s", tmpfs,
- err->message);
+ g_test_message("Can't create temporary directory in %s: %s",
+ g_get_tmp_dir(), err->message);
g_error_free(err);
}
g_assert(tmpfs);
uint32_t size;
buf = fifo8_pop_buf(&s->out_fifo, MIN(len, avail), &size);
- qemu_chr_be_write(s->chr, (uint8_t *)buf, size);
+ qemu_chr_be_write(s->chr, buf, size);
len = qemu_chr_be_can_write(s->chr);
avail -= size;
}
uint32_t size;
buf = fifo8_pop_buf(&vc->vte.out_fifo, MIN(len, avail), &size);
- qemu_chr_be_write(vc->vte.chr, (uint8_t *)buf, size);
+ qemu_chr_be_write(vc->vte.chr, buf, size);
len = qemu_chr_be_can_write(vc->vte.chr);
avail -= size;
}
int has_fg, has_bg;
uint8_t *last_fg, *last_bg;
- last_fg = (uint8_t *) g_malloc(VNC_SERVER_FB_BYTES);
- last_bg = (uint8_t *) g_malloc(VNC_SERVER_FB_BYTES);
+ last_fg = g_malloc(VNC_SERVER_FB_BYTES);
+ last_bg = g_malloc(VNC_SERVER_FB_BYTES);
has_fg = has_bg = 0;
for (j = y; j < (y + h); j += 16) {
for (i = x; i < (x + w); i += 16) {
VncJobQueue *q;
if (vnc_worker_thread_running())
- return ;
+ return;
q = vnc_queue_init();
qemu_thread_create(&q->thread, "vnc_worker", vnc_worker_thread, q,
rect = vnc_stat_rect(vd, x, y);
if (rect->updated) {
- return ;
+ return;
}
rect->times[rect->idx] = *tv;
rect->idx = (rect->idx + 1) % ARRAY_SIZE(rect->times);