qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-block] [PULL 61/61] qemu-img: don't shadow opts variable in img_dd


From: Kevin Wolf
Subject: [Qemu-block] [PULL 61/61] qemu-img: don't shadow opts variable in img_dd()
Date: Fri, 23 Jun 2017 18:21:59 +0200

From: Stefan Hajnoczi <address@hidden>

It's confusing when two different variables have the same name in one
function.

Cc: Reda Sallahi <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
 qemu-img.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index e70d515..91ad6be 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4255,15 +4255,12 @@ static int img_dd(int argc, char **argv)
         case 'U':
             force_share = true;
             break;
-        case OPTION_OBJECT: {
-            QemuOpts *opts;
-            opts = qemu_opts_parse_noisily(&qemu_object_opts,
-                                           optarg, true);
-            if (!opts) {
+        case OPTION_OBJECT:
+            if (!qemu_opts_parse_noisily(&qemu_object_opts, optarg, true)) {
                 ret = -1;
                 goto out;
             }
-        }   break;
+            break;
         case OPTION_IMAGE_OPTS:
             image_opts = true;
             break;
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]