All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-img: don't shadow opts variable in img_dd()
@ 2017-06-19 15:00 Stefan Hajnoczi
  2017-06-19 15:18 ` Max Reitz
  2017-06-20  0:56 ` no-reply
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2017-06-19 15:00 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, Kevin Wolf, Stefan Hajnoczi, Reda Sallahi

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

Cc: Reda Sallahi <fullmanet@gmail.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 qemu-img.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 0ad698d..c285c2f 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -4249,15 +4249,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;
-- 
2.9.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-21 11:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 15:00 [Qemu-devel] [PATCH] qemu-img: don't shadow opts variable in img_dd() Stefan Hajnoczi
2017-06-19 15:18 ` Max Reitz
2017-06-21  8:24   ` Stefan Hajnoczi
2017-06-21 11:30     ` Max Reitz
2017-06-20  0:56 ` no-reply
2017-06-21  8:25   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.