aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr_drc.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2023-09-18 16:58:50 +0200
committerMarkus Armbruster <armbru@redhat.com>2023-09-29 10:07:18 +0200
commit8cf52ff5c727519791eb897410f31c4ad27300cc (patch)
treed86ec7119b21c7ac89f52fb66276720256d9b473 /hw/ppc/spapr_drc.c
parent15675f2318142f8fbfd17b161604fb4f5e9f420e (diff)
spapr/drc: Clean up local variable shadowing in prop_get_fdt()
Rename 'name' variable to avoid this warning : ../hw/ppc/spapr_drc.c: In function ‘prop_get_fdt’: ../hw/ppc/spapr_drc.c:344:21: warning: declaration of ‘name’ shadows a parameter [-Wshadow=compatible-local] 344 | const char *name = NULL; | ^~~~ ../hw/ppc/spapr_drc.c:325:63: note: shadowed declaration is here 325 | static void prop_get_fdt(Object *obj, Visitor *v, const char *name, | ~~~~~~~~~~~~^~~~ Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-ID: <20230918145850.241074-9-clg@kaod.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'hw/ppc/spapr_drc.c')
-rw-r--r--hw/ppc/spapr_drc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c
index 843e318312..2b99d3b4b1 100644
--- a/hw/ppc/spapr_drc.c
+++ b/hw/ppc/spapr_drc.c
@@ -341,7 +341,7 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
fdt_depth = 0;
do {
- const char *name = NULL;
+ const char *dt_name = NULL;
const struct fdt_property *prop = NULL;
int prop_len = 0, name_len = 0;
uint32_t tag;
@@ -351,8 +351,8 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
switch (tag) {
case FDT_BEGIN_NODE:
fdt_depth++;
- name = fdt_get_name(fdt, fdt_offset, &name_len);
- if (!visit_start_struct(v, name, NULL, 0, errp)) {
+ dt_name = fdt_get_name(fdt, fdt_offset, &name_len);
+ if (!visit_start_struct(v, dt_name, NULL, 0, errp)) {
return;
}
break;
@@ -369,8 +369,8 @@ static void prop_get_fdt(Object *obj, Visitor *v, const char *name,
case FDT_PROP: {
int i;
prop = fdt_get_property_by_offset(fdt, fdt_offset, &prop_len);
- name = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
- if (!visit_start_list(v, name, NULL, 0, errp)) {
+ dt_name = fdt_string(fdt, fdt32_to_cpu(prop->nameoff));
+ if (!visit_start_list(v, dt_name, NULL, 0, errp)) {
return;
}
for (i = 0; i < prop_len; i++) {