Patchwork [1/2] block: delete a write-only variable

login
register
mail settings
Submitter Blue Swirl
Date Dec. 17, 2010, 9:40 p.m.
Message ID <AANLkTikY90vJV-8K_FpfxZUAMuFQRS3zqNtcmR_cKNGG@mail.gmail.com>
Download mbox | patch
Permalink /patch/75993/
State New
Headers show

Comments

Blue Swirl - Dec. 17, 2010, 9:40 p.m.
Avoid a warning with GCC 4.6.0:
/src/qemu/block.c: In function 'bdrv_img_create':
/src/qemu/block.c:2862:25: error: variable 'fmt' set but not used
[-Werror=unused-but-set-variable]

CC: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 block.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

             ret = bdrv_open(bs, backing_file->value.s, flags, drv);

Patch

diff --git a/block.c b/block.c
index 9b5e9e1..ff2795b 100644
--- a/block.c
+++ b/block.c
@@ -2859,13 +2859,8 @@  int bdrv_img_create(const char *filename, const
char *fmt,
     if (get_option_parameter(param, BLOCK_OPT_SIZE)->value.n == -1) {
         if (backing_file && backing_file->value.s) {
             uint64_t size;
-            const char *fmt = NULL;
             char buf[32];

-            if (backing_fmt && backing_fmt->value.s) {
-                fmt = backing_fmt->value.s;
-            }
-
             bs = bdrv_new("");