[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/30] block: Fix compiler warning (-Werror=uninitial
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 11/30] block: Fix compiler warning (-Werror=uninitialized) |
Date: |
Fri, 27 Sep 2013 17:39:11 +0200 |
From: Stefan Weil <address@hidden>
The patch fixes a warning from gcc (Debian 4.6.3-14+rpi1) 4.6.3:
block/stream.c:141:22: error:
‘copy’ may be used uninitialized in this function [-Werror=uninitialized]
This is not a real bug - a better compiler would not complain.
Now 'copy' has always a defined value, so the check for ret >= 0
can be removed.
Signed-off-by: Stefan Weil <address@hidden>
Acked-by: Stefan Hajnoczi <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/stream.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/stream.c b/block/stream.c
index 078ce4a..45837f4 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -119,11 +119,12 @@ wait:
break;
}
+ copy = false;
+
ret = bdrv_is_allocated(bs, sector_num,
STREAM_BUFFER_SIZE / BDRV_SECTOR_SIZE, &n);
if (ret == 1) {
/* Allocated in the top, no need to copy. */
- copy = false;
} else if (ret >= 0) {
/* Copy if allocated in the intermediate images. Limit to the
* known-unallocated area [sector_num, sector_num+n). */
@@ -138,7 +139,7 @@ wait:
copy = (ret == 1);
}
trace_stream_one_iteration(s, sector_num, n, ret);
- if (ret >= 0 && copy) {
+ if (copy) {
if (s->common.speed) {
delay_ns = ratelimit_calculate_delay(&s->limit, n);
if (delay_ns > 0) {
--
1.8.1.4
- [Qemu-devel] [PULL 00/30] Block patches, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 01/30] block: fix backing file overriding, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 02/30] qemu-iotests: add test for backing file overriding, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 05/30] block/get_block_status: set *pnum = 0 on error, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 06/30] block/get_block_status: avoid segfault if there is no backing_hd, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 04/30] qcow2: Don't shadow return value, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 03/30] qemu-iotests: Do not execute 052 with -nocache, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 10/30] block: introduce BlockDriver.bdrv_needs_filename to enable some drivers., Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 11/30] block: Fix compiler warning (-Werror=uninitialized),
Kevin Wolf <=
- [Qemu-devel] [PULL 07/30] vmdk: fix cluster size check for flat extents, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 09/30] qemu-iotests: add monolithicFlat creation test to 059, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 08/30] qemu-iotests: fix test case 059, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 17/30] block: qed - use QEMU_PACKED for on-disk structures, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 12/30] qdict: Extract qdict_extract_subqdict, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 15/30] block: vpc - use QEMU_PACKED for on-disk structures, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 20/30] qemu-iotests: fix qmp.py search path, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 14/30] block: vdi - use QEMU_PACKED for on-disk structures, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 13/30] rbd: avoid qemu_rbd_snap_list() memory leaks, Kevin Wolf, 2013/09/27
- [Qemu-devel] [PULL 18/30] qcow2: Assert against currently impossible overflow, Kevin Wolf, 2013/09/27