qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/8] pnv/psi: Clean up local variable shadowing


From: Harsh Prateek Bora
Subject: Re: [PATCH 2/8] pnv/psi: Clean up local variable shadowing
Date: Tue, 19 Sep 2023 12:27:56 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0



On 9/18/23 20:28, Cédric Le Goater wrote:
to fix :

   ../hw/ppc/pnv_psi.c: In function ‘pnv_psi_p9_mmio_write’:
   ../hw/ppc/pnv_psi.c:741:24: warning: declaration of ‘addr’ shadows a 
parameter [-Wshadow=compatible-local]
     741 |                 hwaddr addr = val & ~(PSIHB9_ESB_CI_VALID | 
PSIHB10_ESB_CI_64K);
         |                        ^~~~
   ../hw/ppc/pnv_psi.c:702:56: note: shadowed declaration is here
     702 | static void pnv_psi_p9_mmio_write(void *opaque, hwaddr addr,
         |                                                 ~~~~~~~^~~~

Signed-off-by: Cédric Le Goater <clg@kaod.org>
---
  hw/ppc/pnv_psi.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index daaa2f0575fd..26460d210deb 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -738,8 +738,9 @@ static void pnv_psi_p9_mmio_write(void *opaque, hwaddr addr,
              }
          } else {
              if (!(psi->regs[reg] & PSIHB9_ESB_CI_VALID)) {
-                hwaddr addr = val & ~(PSIHB9_ESB_CI_VALID | 
PSIHB10_ESB_CI_64K);
-                memory_region_add_subregion(sysmem, addr,
+                hwaddr esb_addr =

While at it, we may want to move the declaration to the beginning of the function. Anyways,

Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>

+                    val & ~(PSIHB9_ESB_CI_VALID | PSIHB10_ESB_CI_64K);
+                memory_region_add_subregion(sysmem, esb_addr,
                                              &psi9->source.esb_mmio);
              }
          }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]