Skip to content

Commit

Permalink
sysemu/device_tree: Clean up local variable shadowing
Browse files Browse the repository at this point in the history
Fix:

  hw/mips/boston.c:472:5: error: declaration shadows a local variable [-Werror,-Wshadow]
    qemu_fdt_setprop_cells(fdt, name, "reg", reg_base, reg_size);
    ^
  include/sysemu/device_tree.h:129:13: note: expanded from macro 'qemu_fdt_setprop_cells'
        int i;
            ^
  hw/mips/boston.c:461:9: note: previous declaration is here
    int i;
        ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20230904161235.84651-21-philmd@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
philmd authored and Markus Armbruster committed Sep 29, 2023
1 parent 7f087a3 commit 720d6bc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/sysemu/device_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ int qemu_fdt_add_path(void *fdt, const char *path);
#define qemu_fdt_setprop_cells(fdt, node_path, property, ...) \
do { \
uint32_t qdt_tmp[] = { __VA_ARGS__ }; \
int i; \
\
for (i = 0; i < ARRAY_SIZE(qdt_tmp); i++) { \
qdt_tmp[i] = cpu_to_be32(qdt_tmp[i]); \
for (unsigned i_ = 0; i_ < ARRAY_SIZE(qdt_tmp); i_++) { \
qdt_tmp[i_] = cpu_to_be32(qdt_tmp[i_]); \
} \
qemu_fdt_setprop(fdt, node_path, property, qdt_tmp, \
sizeof(qdt_tmp)); \
Expand Down

0 comments on commit 720d6bc

Please sign in to comment.