Skip to content

Commit

Permalink
hw/misc/arm_sysctl.c: Avoid shadowing local variable
Browse files Browse the repository at this point in the history
Avoid shadowing a local variable in arm_sysctl_write():

../../hw/misc/arm_sysctl.c: In function ‘arm_sysctl_write’:
../../hw/misc/arm_sysctl.c:537:26: warning: declaration of ‘val’ shadows a parameter [-Wshadow=local]
  537 |                 uint32_t val;
      |                          ^~~
../../hw/misc/arm_sysctl.c:388:39: note: shadowed declaration is here
  388 |                              uint64_t val, unsigned size)
      |                              ~~~~~~~~~^~~

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20230922152944.3583438-3-peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
  • Loading branch information
pm215 authored and Markus Armbruster committed Sep 29, 2023
1 parent 33b3b4a commit b2e7e20
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hw/misc/arm_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,12 @@ static void arm_sysctl_write(void *opaque, hwaddr offset,
s->sys_cfgstat |= 2; /* error */
}
} else {
uint32_t val;
uint32_t data;
if (!vexpress_cfgctrl_read(s, dcc, function, site, position,
device, &val)) {
device, &data)) {
s->sys_cfgstat |= 2; /* error */
} else {
s->sys_cfgdata = val;
s->sys_cfgdata = data;
}
}
}
Expand Down

0 comments on commit b2e7e20

Please sign in to comment.