Skip to content

Commit

Permalink
Merge branch 'trivial-patches' of git://git.corpit.ru/qemu
Browse files Browse the repository at this point in the history
* 'trivial-patches' of git://git.corpit.ru/qemu:
  target-mips: Remove assignment to a variable which is never used
  misc: Use g_assert_not_reached for code which is expected to be unreachable
  qemu-options: mention C-a h in the -nographic doc
  misc: Fix new typos in comments and strings
  linux-user: correct argument number for sys_mremap and sys_splice
  PPC: dbdma: macio: Fix format specifiers (build regression)
  watchdog: Remove break after exit
  exec: Remove env from list of poisoned names
  hw/9pfs: Fix potential memory leak and avoid reuse of freed memory
  timer: make timers_state static
  aes: Remove unused code (NDEBUG, u16)
  • Loading branch information
aurel32 committed Jul 29, 2013
2 parents b6a9f46 + 6c86f40 commit 461bdb3
Show file tree
Hide file tree
Showing 22 changed files with 43 additions and 45 deletions.
2 changes: 1 addition & 1 deletion block/vhdx.h
Expand Up @@ -168,7 +168,7 @@ typedef struct QEMU_PACKED VHDXLogEntryHeader {
vhdx_header. If not found in
vhdx_header, it is invalid */
uint64_t flushed_file_offset; /* see spec for full details - this
sould be vhdx file size in bytes */
should be vhdx file size in bytes */
uint64_t last_file_offset; /* size in bytes that all allocated
file structures fit into */
} VHDXLogEntryHeader;
Expand Down
2 changes: 1 addition & 1 deletion blockdev.c
Expand Up @@ -1029,7 +1029,7 @@ static void abort_prepare(BlkTransactionState *common, Error **errp)

static void abort_commit(BlkTransactionState *common)
{
assert(false); /* this action never succeeds */
g_assert_not_reached(); /* this action never succeeds */
}

static const BdrvActionOps actions[] = {
Expand Down
2 changes: 1 addition & 1 deletion cpus.c
Expand Up @@ -112,7 +112,7 @@ typedef struct TimersState {
int64_t dummy;
} TimersState;

TimersState timers_state;
static TimersState timers_state;

/* Return the virtual CPU time, based on the instruction counter. */
int64_t cpu_get_icount(void)
Expand Down
2 changes: 1 addition & 1 deletion docs/rdma.txt
Expand Up @@ -199,7 +199,7 @@ Version #1 requires that all server implementations of the protocol must
check this field and register all requests found in the array of commands located
in the data portion and return an equal number of results in the response.
The maximum number of repeats is hard-coded to 4096. This is a conservative
limit based on the maximum size of a SEND message along with emperical
limit based on the maximum size of a SEND message along with empirical
observations on the maximum future benefit of simultaneous page registrations.

The 'type' field has 12 different command values:
Expand Down
2 changes: 2 additions & 0 deletions hw/9pfs/virtio-9p-proxy.c
Expand Up @@ -1153,10 +1153,12 @@ static int proxy_init(FsContext *ctx)
sock_id = atoi(ctx->fs_root);
if (sock_id < 0) {
fprintf(stderr, "socket descriptor not initialized\n");
g_free(proxy);
return -1;
}
}
g_free(ctx->fs_root);
ctx->fs_root = NULL;

proxy->in_iovec.iov_base = g_malloc(PROXY_MAX_IO_SZ + PROXY_HDR_SZ);
proxy->in_iovec.iov_len = PROXY_MAX_IO_SZ + PROXY_HDR_SZ;
Expand Down
9 changes: 5 additions & 4 deletions hw/ide/macio.c
Expand Up @@ -131,7 +131,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9);
int nsector = io->len >> 9;

MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
unaligned, io->addr + io->len - unaligned);

bdrv_read(s->bs, sector_num + nsector, io->remainder, 1);
Expand Down Expand Up @@ -212,14 +212,15 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
s->nsector -= n;
}

MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d sector_num: %ld\n",
MACIO_DPRINTF("remainder: %d io->len: %d nsector: %d "
"sector_num: %" PRId64 "\n",
io->remainder_len, io->len, s->nsector, sector_num);
if (io->remainder_len && io->len) {
/* guest wants the rest of its previous transfer */
int remainder_len = MIN(io->remainder_len, io->len);
uint8_t *p = &io->remainder[0x200 - remainder_len];

MACIO_DPRINTF("copying remainder %d bytes at %#lx\n",
MACIO_DPRINTF("copying remainder %d bytes at %#" HWADDR_PRIx "\n",
remainder_len, io->addr);

switch (s->dma_cmd) {
Expand Down Expand Up @@ -261,7 +262,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret)
if (unaligned) {
int nsector = io->len >> 9;

MACIO_DPRINTF("precopying unaligned %d bytes to %#lx\n",
MACIO_DPRINTF("precopying unaligned %d bytes to %#" HWADDR_PRIx "\n",
unaligned, io->addr + io->len - unaligned);

switch (s->dma_cmd) {
Expand Down
16 changes: 8 additions & 8 deletions hw/net/vmxnet3.c
Expand Up @@ -528,7 +528,7 @@ vmxnet3_setup_tx_offloads(VMXNET3State *s)
break;

default:
assert(false);
g_assert_not_reached();
return false;
}

Expand Down Expand Up @@ -575,7 +575,7 @@ vmxnet3_on_tx_done_update_stats(VMXNET3State *s, int qidx,
stats->ucastBytesTxOK += tot_len;
break;
default:
assert(false);
g_assert_not_reached();
}

if (s->offload_mode == VMXNET3_OM_TSO) {
Expand All @@ -599,7 +599,7 @@ vmxnet3_on_tx_done_update_stats(VMXNET3State *s, int qidx,
break;

default:
assert(false);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -634,7 +634,7 @@ vmxnet3_on_rx_done_update_stats(VMXNET3State *s,
stats->ucastBytesRxOK += tot_len;
break;
default:
assert(false);
g_assert_not_reached();
}

if (tot_len > s->mtu) {
Expand All @@ -643,7 +643,7 @@ vmxnet3_on_rx_done_update_stats(VMXNET3State *s,
}
break;
default:
assert(false);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -1106,7 +1106,7 @@ vmxnet3_io_bar0_read(void *opaque, hwaddr addr, unsigned size)
{
if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_IMR,
VMXNET3_MAX_INTRS, VMXNET3_REG_ALIGN)) {
assert(false);
g_assert_not_reached();
}

VMW_CBPRN("BAR0 unknown read [%" PRIx64 "], size %d", addr, size);
Expand Down Expand Up @@ -1651,7 +1651,7 @@ vmxnet3_io_bar1_write(void *opaque,
case VMXNET3_REG_ICR:
VMW_CBPRN("Write BAR1 [VMXNET3_REG_ICR] = %" PRIx64 ", size %d",
val, size);
assert(false);
g_assert_not_reached();
break;

/* Event Cause Register */
Expand Down Expand Up @@ -1801,7 +1801,7 @@ vmxnet3_rx_filter_may_indicate(VMXNET3State *s, const void *data,
break;

default:
assert(false);
g_assert_not_reached();
}

return true;
Expand Down
2 changes: 1 addition & 1 deletion hw/net/vmxnet_tx_pkt.c
Expand Up @@ -287,7 +287,7 @@ void vmxnet_tx_pkt_build_vheader(struct VmxnetTxPkt *pkt, bool tso_enable,
break;

default:
assert(false);
g_assert_not_reached();
}

if (csum_enable) {
Expand Down
8 changes: 4 additions & 4 deletions hw/usb/hcd-ehci.c
Expand Up @@ -1357,7 +1357,7 @@ static void ehci_execute_complete(EHCIQueue *q)
default:
/* should not be triggerable */
fprintf(stderr, "USB invalid response %d\n", p->packet.status);
assert(0);
g_assert_not_reached();
break;
}

Expand Down Expand Up @@ -2142,7 +2142,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
default:
fprintf(stderr, "Bad state!\n");
again = -1;
assert(0);
g_assert_not_reached();
break;
}

Expand Down Expand Up @@ -2206,7 +2206,7 @@ static void ehci_advance_async_state(EHCIState *ehci)
/* this should only be due to a developer mistake */
fprintf(stderr, "ehci: Bad asynchronous state %d. "
"Resetting to active\n", ehci->astate);
assert(0);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -2256,7 +2256,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
/* this should only be due to a developer mistake */
fprintf(stderr, "ehci: Bad periodic state %d. "
"Resetting to active\n", ehci->pstate);
assert(0);
g_assert_not_reached();
}
}

Expand Down
4 changes: 2 additions & 2 deletions hw/virtio/virtio-balloon.c
Expand Up @@ -53,8 +53,8 @@ static const char *balloon_stat_names[] = {
/*
* reset_stats - Mark all items in the stats array as unset
*
* This function needs to be called at device intialization and before
* before updating to a set of newly-generated stats. This will ensure that no
* This function needs to be called at device initialization and before
* updating to a set of newly-generated stats. This will ensure that no
* stale values stick around in case the guest reports a subset of the supported
* statistics.
*/
Expand Down
1 change: 0 additions & 1 deletion hw/watchdog/watchdog.c
Expand Up @@ -128,7 +128,6 @@ void watchdog_perform_action(void)
case WDT_POWEROFF: /* same as 'quit' command in monitor */
watchdog_mon_event("poweroff");
exit(0);
break;

case WDT_PAUSE: /* same as 'stop' command in monitor */
watchdog_mon_event("pause");
Expand Down
3 changes: 2 additions & 1 deletion hw/xen/xen_pt.c
Expand Up @@ -756,7 +756,8 @@ static int xen_pt_initfn(PCIDevice *d)
out:
memory_listener_register(&s->memory_listener, &address_space_memory);
memory_listener_register(&s->io_listener, &address_space_io);
XEN_PT_LOG(d, "Real physical device %02x:%02x.%d registered successfuly!\n",
XEN_PT_LOG(d,
"Real physical device %02x:%02x.%d registered successfully!\n",
s->hostaddr.bus, s->hostaddr.slot, s->hostaddr.function);

return 0;
Expand Down
1 change: 0 additions & 1 deletion include/exec/poison.h
Expand Up @@ -36,7 +36,6 @@
#pragma GCC poison TARGET_PAGE_ALIGN

#pragma GCC poison CPUArchState
#pragma GCC poison env

#pragma GCC poison lduw_phys
#pragma GCC poison ldl_phys
Expand Down
4 changes: 2 additions & 2 deletions migration-rdma.c
Expand Up @@ -2494,7 +2494,7 @@ static int qemu_rdma_close(void *opaque)
* @size == 0 :
* A 'hint' or 'advice' that means that we wish to speculatively
* and asynchronously unregister this memory. In this case, there is no
* gaurantee that the unregister will actually happen, for example,
* guarantee that the unregister will actually happen, for example,
* if the memory is being actively transmitted. Additionally, the memory
* may be re-registered at any future time if a write within the same
* chunk was requested again, even if you attempted to unregister it
Expand Down Expand Up @@ -2570,7 +2570,7 @@ static size_t qemu_rdma_save_page(QEMUFile *f, void *opaque,
qemu_rdma_signal_unregister(rdma, index, chunk, 0);

/*
* TODO: Synchronous, gauranteed unregistration (should not occur during
* TODO: Synchronous, guaranteed unregistration (should not occur during
* fast-path). Otherwise, unregisters will process on the next call to
* qemu_rdma_drain_cq()
if (size < 0) {
Expand Down
2 changes: 1 addition & 1 deletion net/eth.c
Expand Up @@ -73,7 +73,7 @@ eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr, uint8_t l4proto)
}

/* Unsupported offload */
assert(false);
g_assert_not_reached();

return VIRTIO_NET_HDR_GSO_NONE | ecn_state;
}
Expand Down
4 changes: 2 additions & 2 deletions qdev-monitor.c
Expand Up @@ -360,7 +360,7 @@ static BusState *qbus_find(const char *path)

/* find device */
if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
assert(0);
g_assert_not_reached();
elem[0] = len = 0;
}
pos += len;
Expand Down Expand Up @@ -397,7 +397,7 @@ static BusState *qbus_find(const char *path)

/* find bus */
if (sscanf(path+pos, "%127[^/]%n", elem, &len) != 1) {
assert(0);
g_assert_not_reached();
elem[0] = len = 0;
}
pos += len;
Expand Down
3 changes: 2 additions & 1 deletion qemu-options.hx
Expand Up @@ -844,7 +844,8 @@ you can totally disable graphical output so that QEMU is a simple
command line application. The emulated serial port is redirected on
the console and muxed with the monitor (unless redirected elsewhere
explicitly). Therefore, you can still use QEMU to debug a Linux kernel
with a serial console.
with a serial console. Use @key{C-a h} for help on switching between
the console and monitor.
ETEXI

DEF("curses", 0, QEMU_OPTION_curses,
Expand Down
2 changes: 1 addition & 1 deletion target-arm/helper.c
Expand Up @@ -1653,7 +1653,7 @@ void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu,
"was %s, now %s\n", r2->cp, 32 + 32 * is64,
r2->crn, r2->crm, r2->opc1, r2->opc2,
oldreg->name, r2->name);
assert(0);
g_assert_not_reached();
}
}
g_hash_table_insert(cpu->cp_regs, key, r2);
Expand Down
2 changes: 1 addition & 1 deletion tests/test-qmp-input-visitor.c
Expand Up @@ -394,7 +394,7 @@ static void test_native_list_integer_helper(TestInputVisitorData *data,
break;
}
default:
g_assert(false);
g_assert_not_reached();
}

g_string_free(gstr_union, true);
Expand Down
4 changes: 2 additions & 2 deletions tests/test-qmp-output-visitor.c
Expand Up @@ -559,7 +559,7 @@ static void init_native_list(UserDefNativeListUnion *cvalue)
break;
}
default:
g_assert(false);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -645,7 +645,7 @@ static void check_native_list(QObject *qobj,
}
break;
default:
g_assert(false);
g_assert_not_reached();
}
QDECREF(qlist);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/test-visitor-serialization.c
Expand Up @@ -136,7 +136,7 @@ static void visit_primitive_type(Visitor *v, void **native, Error **errp)
visit_type_int64(v, &pt->value.s64, NULL, errp);
break;
case PTYPE_EOL:
g_assert(false);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -181,7 +181,7 @@ static void visit_primitive_list(Visitor *v, void **native, Error **errp)
visit_type_uint64List(v, &pl->value.u64_integers, NULL, errp);
break;
default:
g_assert(false);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -500,7 +500,7 @@ static void test_primitive_lists(gconstpointer opaque)
break;
}
default:
g_assert(0);
g_assert_not_reached();
}
}

Expand Down Expand Up @@ -656,7 +656,7 @@ static void test_primitive_lists(gconstpointer opaque)
break;
}
default:
g_assert(0);
g_assert_not_reached();
}
i++;
} while (cur_head);
Expand Down
5 changes: 0 additions & 5 deletions util/aes.c
Expand Up @@ -30,12 +30,7 @@
#include "qemu-common.h"
#include "qemu/aes.h"

#ifndef NDEBUG
#define NDEBUG
#endif

typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;

/* This controls loop-unrolling in aes_core.c */
Expand Down

0 comments on commit 461bdb3

Please sign in to comment.