Re: [PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing

2023-10-05 Thread John Snow
On Wed, Oct 4, 2023 at 8:00 AM Philippe Mathieu-Daudé  wrote:
>
> Fix:
>
>   hw/ide/ahci.c:1577:23: error: declaration shadows a local variable 
> [-Werror,-Wshadow]
> IDEState *s = >port.ifs[j];
>   ^
>   hw/ide/ahci.c:1569:29: note: previous declaration is here
> void ahci_uninit(AHCIState *s)
> ^
>
> Signed-off-by: Philippe Mathieu-Daudé 

Reviewed-by: John Snow 

> ---
>  hw/ide/ahci.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> index d0a774bc17..fcc5476e9e 100644
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -1622,9 +1622,7 @@ void ahci_uninit(AHCIState *s)
>  AHCIDevice *ad = >dev[i];
>
>  for (j = 0; j < 2; j++) {
> -IDEState *s = >port.ifs[j];
> -
> -ide_exit(s);
> +ide_exit(>port.ifs[j]);
>  }
>  object_unparent(OBJECT(>port));
>  }
> --
> 2.41.0
>




[PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing

2023-10-04 Thread Philippe Mathieu-Daudé
Fix:

  hw/ide/ahci.c:1577:23: error: declaration shadows a local variable 
[-Werror,-Wshadow]
IDEState *s = >port.ifs[j];
  ^
  hw/ide/ahci.c:1569:29: note: previous declaration is here
void ahci_uninit(AHCIState *s)
^

Signed-off-by: Philippe Mathieu-Daudé 
---
 hw/ide/ahci.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
index d0a774bc17..fcc5476e9e 100644
--- a/hw/ide/ahci.c
+++ b/hw/ide/ahci.c
@@ -1622,9 +1622,7 @@ void ahci_uninit(AHCIState *s)
 AHCIDevice *ad = >dev[i];
 
 for (j = 0; j < 2; j++) {
-IDEState *s = >port.ifs[j];
-
-ide_exit(s);
+ide_exit(>port.ifs[j]);
 }
 object_unparent(OBJECT(>port));
 }
-- 
2.41.0