[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing
From: |
John Snow |
Subject: |
Re: [PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing |
Date: |
Thu, 5 Oct 2023 11:48:01 -0400 |
On Wed, Oct 4, 2023 at 8:00 AM Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Fix:
>
> hw/ide/ahci.c:1577:23: error: declaration shadows a local variable
> [-Werror,-Wshadow]
> IDEState *s = &ad->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é <philmd@linaro.org>
Reviewed-by: John Snow <jsnow@redhat.com>
> ---
> 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 = &s->dev[i];
>
> for (j = 0; j < 2; j++) {
> - IDEState *s = &ad->port.ifs[j];
> -
> - ide_exit(s);
> + ide_exit(&ad->port.ifs[j]);
> }
> object_unparent(OBJECT(&ad->port));
> }
> --
> 2.41.0
>
- [PATCH v3 00/16] (few more) Steps towards enabling -Wshadow, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 01/16] hw/audio/soundhw: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing, Philippe Mathieu-Daudé, 2023/10/04
- Re: [PATCH v3 02/16] hw/ide/ahci: Clean up local variable shadowing,
John Snow <=
- [PATCH v3 05/16] plugins/loader: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 08/16] qom/object_interfaces: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 04/16] os-posix: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 11/16] util/cutils: Clean up global variable shadowing in get_relocated_path(), Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 03/16] net/net: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/10/04
- [PATCH v3 09/16] semihosting: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/10/04