lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANn89iJ0ePmPZW6c3XzUbm_kND1r_EPxz7xNHgroAZwzDjn5eA@mail.gmail.com>
Date: Fri, 21 Feb 2025 19:18:26 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Breno Leitao <leitao@...ian.org>
Cc: "David S. Miller" <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, 
	Paolo Abeni <pabeni@...hat.com>, Simon Horman <horms@...nel.org>, netdev@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: Remove shadow variable in netdev_run_todo()

On Fri, Feb 21, 2025 at 6:51 PM Breno Leitao <leitao@...ian.org> wrote:
>
> Fix a shadow variable warning in net/core/dev.c when compiled with
> CONFIG_LOCKDEP enabled. The warning occurs because 'dev' is redeclared
> inside the while loop, shadowing the outer scope declaration.
>
>         net/core/dev.c:11211:22: warning: declaration shadows a local variable [-Wshadow]
>                 struct net_device *dev = list_first_entry(&unlink_list,
>
>         net/core/dev.c:11202:21: note: previous declaration is here
>                 struct net_device *dev, *tmp;
>
> Remove the redundant declaration since the variable is already defined
> in the outer scope and will be overwritten in the subsequent
> list_for_each_entry_safe() loop anyway.
>
> Signed-off-by: Breno Leitao <leitao@...ian.org>

Reviewed-by: Eric Dumazet <edumazet@...gle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ