Skip to contentSkip to conversation

qemu_opt_print: Remove shadowing opt decl

PATCH In review Dr. David Alan Gilbert (git) 3 participants 5 messages Oct 5, 2017 – Oct 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu_opt_print: Remove shadowing opt decl

From: "Dr. David Alan Gilbert" <[email protected]>

opt was declared as a separate local inside the last loop, shadowing the local at the top of the function.

---
 util/qemu-option.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/qemu-option.c +1 -1
index 9b1dc8093b..877c5b4d67 100644
@@ -766,7 +766,7 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
     }
     for (; desc && desc->name; desc++) {
         const char *value;
-        QemuOpt *opt = qemu_opt_find(opts, desc->name);
+        opt = qemu_opt_find(opts, desc->name);
 
         value = opt ? opt->str : desc->def_value_str;
         if (!value) {
Signature · 1 line
2.13.6
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

opt was declared as a separate local inside the last loop, shadowing the local at the top of the function.

---
 util/qemu-option.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
util/qemu-option.c +1 -1
index 9b1dc8093b..877c5b4d67 100644
@@ -766,7 +766,7 @@ void qemu_opts_print(QemuOpts *opts, const char *separator)
     }
     for (; desc && desc->name; desc++) {
         const char *value;
-        QemuOpt *opt = qemu_opt_find(opts, desc->name);
+        opt = qemu_opt_find(opts, desc->name);
 
         value = opt ? opt->str : desc->def_value_str;
         if (!value) {
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#3 lore raw
Quoted 10 lines · Markus Armbruster
Quoted 6 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

opt was declared as a separate local inside the last loop, shadowing the local at the top of the function.

I can take this through my tree.

I'd like to change the headline to "option: Remove shadowing opt decl from qemu_opt_print()", if that's alright with you.

#4 lore raw
Quoted 9 lines · * Markus Armbruster ([email protected]) wrote:
Quoted 7 lines · Markus Armbruster
Quoted 5 lines · Dr. David Alan Gilbert (git)

From: "Dr. David Alan Gilbert" <[email protected]>

opt was declared as a separate local inside the last loop, shadowing the local at the top of the function.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I can take this through my tree.

I'd like to change the headline to "option: Remove shadowing opt decl from qemu_opt_print()", if that's alright with you.

Sure.

Dave

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK