* [Qemu-devel] [PATCH] qcow2-refcount: remove write-only variables
@ 2011-01-29 8:41 Blue Swirl
2011-01-31 9:06 ` [Qemu-devel] " Kevin Wolf
0 siblings, 1 reply; 2+ messages in thread
From: Blue Swirl @ 2011-01-29 8:41 UTC (permalink / raw)
To: Kevin Wolf, qemu-devel
[-- Attachment #1: Type: text/plain, Size: 2039 bytes --]
Variables l2_modified and l2_size are not really used, remove them.
Spotted by GCC 4.6.0:
CC block/qcow2-refcount.o
/src/qemu/block/qcow2-refcount.c: In function 'qcow2_update_snapshot_refcount':
/src/qemu/block/qcow2-refcount.c:708:37: error: variable 'l2_modified'
set but not used [-Werror=unused-but-set-variable]
/src/qemu/block/qcow2-refcount.c:708:9: error: variable 'l2_size' set
but not used [-Werror=unused-but-set-variable]
CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
block/qcow2-refcount.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index e37e226..915d85a 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -705,7 +705,7 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
BDRVQcowState *s = bs->opaque;
uint64_t *l1_table, *l2_table, l2_offset, offset, l1_size2, l1_allocated;
int64_t old_offset, old_l2_offset;
- int l2_size, i, j, l1_modified, l2_modified, nb_csectors, refcount;
+ int i, j, l1_modified, nb_csectors, refcount;
int ret;
l2_table = NULL;
@@ -729,14 +729,12 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
l1_allocated = 0;
}
- l2_size = s->l2_size * sizeof(uint64_t);
l1_modified = 0;
for(i = 0; i < l1_size; i++) {
l2_offset = l1_table[i];
if (l2_offset) {
old_l2_offset = l2_offset;
l2_offset &= ~QCOW_OFLAG_COPIED;
- l2_modified = 0;
ret = qcow2_cache_get(bs, s->l2_table_cache, l2_offset,
(void**) &l2_table);
@@ -788,7 +786,6 @@ int qcow2_update_snapshot_refcount(BlockDriverState *bs,
s->refcount_block_cache);
}
l2_table[j] = cpu_to_be64(offset);
- l2_modified = 1;
qcow2_cache_entry_mark_dirty(s->l2_table_cache, l2_table);
}
}
--
1.6.2.4
[-- Attachment #2: 0001-qcow2-refcount-remove-write-only-variables.patch --]
[-- Type: application/x-patch, Size: 2278 bytes --]
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Qemu-devel] Re: [PATCH] qcow2-refcount: remove write-only variables
2011-01-29 8:41 [Qemu-devel] [PATCH] qcow2-refcount: remove write-only variables Blue Swirl
@ 2011-01-31 9:06 ` Kevin Wolf
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Wolf @ 2011-01-31 9:06 UTC (permalink / raw)
To: Blue Swirl; +Cc: qemu-devel
Am 29.01.2011 09:41, schrieb Blue Swirl:
> Variables l2_modified and l2_size are not really used, remove them.
> Spotted by GCC 4.6.0:
> CC block/qcow2-refcount.o
> /src/qemu/block/qcow2-refcount.c: In function 'qcow2_update_snapshot_refcount':
> /src/qemu/block/qcow2-refcount.c:708:37: error: variable 'l2_modified'
> set but not used [-Werror=unused-but-set-variable]
> /src/qemu/block/qcow2-refcount.c:708:9: error: variable 'l2_size' set
> but not used [-Werror=unused-but-set-variable]
>
> CC: Kevin Wolf <kwolf@redhat.com>
> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Thanks, applied to the block branch.
Kevin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-31 9:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-29 8:41 [Qemu-devel] [PATCH] qcow2-refcount: remove write-only variables Blue Swirl
2011-01-31 9:06 ` [Qemu-devel] " Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).