Skip to content

Commit 461bdb3

Browse files
committed
Merge branch 'trivial-patches' of git://git.corpit.ru/qemu
* '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)
2 parents b6a9f46 + 6c86f40 commit 461bdb3

File tree

22 files changed

+43
-45
lines changed

22 files changed

+43
-45
lines changed

block/vhdx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ typedef struct QEMU_PACKED VHDXLogEntryHeader {
168168
vhdx_header. If not found in
169169
vhdx_header, it is invalid */
170170
uint64_t flushed_file_offset; /* see spec for full details - this
171-
sould be vhdx file size in bytes */
171+
should be vhdx file size in bytes */
172172
uint64_t last_file_offset; /* size in bytes that all allocated
173173
file structures fit into */
174174
} VHDXLogEntryHeader;

blockdev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,7 @@ static void abort_prepare(BlkTransactionState *common, Error **errp)
10291029

10301030
static void abort_commit(BlkTransactionState *common)
10311031
{
1032-
assert(false); /* this action never succeeds */
1032+
g_assert_not_reached(); /* this action never succeeds */
10331033
}
10341034

10351035
static const BdrvActionOps actions[] = {

cpus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ typedef struct TimersState {
112112
int64_t dummy;
113113
} TimersState;
114114

115-
TimersState timers_state;
115+
static TimersState timers_state;
116116

117117
/* Return the virtual CPU time, based on the instruction counter. */
118118
int64_t cpu_get_icount(void)

docs/rdma.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Version #1 requires that all server implementations of the protocol must
199199
check this field and register all requests found in the array of commands located
200200
in the data portion and return an equal number of results in the response.
201201
The maximum number of repeats is hard-coded to 4096. This is a conservative
202-
limit based on the maximum size of a SEND message along with emperical
202+
limit based on the maximum size of a SEND message along with empirical
203203
observations on the maximum future benefit of simultaneous page registrations.
204204

205205
The 'type' field has 12 different command values:

hw/9pfs/virtio-9p-proxy.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,10 +1153,12 @@ static int proxy_init(FsContext *ctx)
11531153
sock_id = atoi(ctx->fs_root);
11541154
if (sock_id < 0) {
11551155
fprintf(stderr, "socket descriptor not initialized\n");
1156+
g_free(proxy);
11561157
return -1;
11571158
}
11581159
}
11591160
g_free(ctx->fs_root);
1161+
ctx->fs_root = NULL;
11601162

11611163
proxy->in_iovec.iov_base = g_malloc(PROXY_MAX_IO_SZ + PROXY_HDR_SZ);
11621164
proxy->in_iovec.iov_len = PROXY_MAX_IO_SZ + PROXY_HDR_SZ;

hw/ide/macio.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret)
131131
int sector_num = (s->lba << 2) + (s->io_buffer_index >> 9);
132132
int nsector = io->len >> 9;
133133

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

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

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

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

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

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

267268
switch (s->dma_cmd) {

hw/net/vmxnet3.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ vmxnet3_setup_tx_offloads(VMXNET3State *s)
528528
break;
529529

530530
default:
531-
assert(false);
531+
g_assert_not_reached();
532532
return false;
533533
}
534534

@@ -575,7 +575,7 @@ vmxnet3_on_tx_done_update_stats(VMXNET3State *s, int qidx,
575575
stats->ucastBytesTxOK += tot_len;
576576
break;
577577
default:
578-
assert(false);
578+
g_assert_not_reached();
579579
}
580580

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

601601
default:
602-
assert(false);
602+
g_assert_not_reached();
603603
}
604604
}
605605

@@ -634,7 +634,7 @@ vmxnet3_on_rx_done_update_stats(VMXNET3State *s,
634634
stats->ucastBytesRxOK += tot_len;
635635
break;
636636
default:
637-
assert(false);
637+
g_assert_not_reached();
638638
}
639639

640640
if (tot_len > s->mtu) {
@@ -643,7 +643,7 @@ vmxnet3_on_rx_done_update_stats(VMXNET3State *s,
643643
}
644644
break;
645645
default:
646-
assert(false);
646+
g_assert_not_reached();
647647
}
648648
}
649649

@@ -1106,7 +1106,7 @@ vmxnet3_io_bar0_read(void *opaque, hwaddr addr, unsigned size)
11061106
{
11071107
if (VMW_IS_MULTIREG_ADDR(addr, VMXNET3_REG_IMR,
11081108
VMXNET3_MAX_INTRS, VMXNET3_REG_ALIGN)) {
1109-
assert(false);
1109+
g_assert_not_reached();
11101110
}
11111111

11121112
VMW_CBPRN("BAR0 unknown read [%" PRIx64 "], size %d", addr, size);
@@ -1651,7 +1651,7 @@ vmxnet3_io_bar1_write(void *opaque,
16511651
case VMXNET3_REG_ICR:
16521652
VMW_CBPRN("Write BAR1 [VMXNET3_REG_ICR] = %" PRIx64 ", size %d",
16531653
val, size);
1654-
assert(false);
1654+
g_assert_not_reached();
16551655
break;
16561656

16571657
/* Event Cause Register */
@@ -1801,7 +1801,7 @@ vmxnet3_rx_filter_may_indicate(VMXNET3State *s, const void *data,
18011801
break;
18021802

18031803
default:
1804-
assert(false);
1804+
g_assert_not_reached();
18051805
}
18061806

18071807
return true;

hw/net/vmxnet_tx_pkt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ void vmxnet_tx_pkt_build_vheader(struct VmxnetTxPkt *pkt, bool tso_enable,
287287
break;
288288

289289
default:
290-
assert(false);
290+
g_assert_not_reached();
291291
}
292292

293293
if (csum_enable) {

hw/usb/hcd-ehci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ static void ehci_execute_complete(EHCIQueue *q)
13571357
default:
13581358
/* should not be triggerable */
13591359
fprintf(stderr, "USB invalid response %d\n", p->packet.status);
1360-
assert(0);
1360+
g_assert_not_reached();
13611361
break;
13621362
}
13631363

@@ -2142,7 +2142,7 @@ static void ehci_advance_state(EHCIState *ehci, int async)
21422142
default:
21432143
fprintf(stderr, "Bad state!\n");
21442144
again = -1;
2145-
assert(0);
2145+
g_assert_not_reached();
21462146
break;
21472147
}
21482148

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

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

hw/virtio/virtio-balloon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ static const char *balloon_stat_names[] = {
5353
/*
5454
* reset_stats - Mark all items in the stats array as unset
5555
*
56-
* This function needs to be called at device intialization and before
57-
* before updating to a set of newly-generated stats. This will ensure that no
56+
* This function needs to be called at device initialization and before
57+
* updating to a set of newly-generated stats. This will ensure that no
5858
* stale values stick around in case the guest reports a subset of the supported
5959
* statistics.
6060
*/

0 commit comments

Comments
 (0)