diff options
| author | Breno Leitao <[email protected]> | 2025-02-17 15:48:13 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2025-02-19 02:10:56 +0000 |
| commit | 8f02c48f8f623eedc3c0a26a64c7ef155c35bfb9 (patch) | |
| tree | 88216a9f48639dbf947d6e9a5ca14b526476968a /net/ipv4/tcp.c | |
| parent | selftests: net: Fix few spelling mistakes (diff) | |
| download | kernel-8f02c48f8f623eedc3c0a26a64c7ef155c35bfb9.tar.gz kernel-8f02c48f8f623eedc3c0a26a64c7ef155c35bfb9.zip | |
net: Remove redundant variable declaration in __dev_change_flags()
The old_flags variable is declared twice in __dev_change_flags(),
causing a shadow variable warning. This patch fixes the issue by
removing the redundant declaration, reusing the existing old_flags
variable instead.
net/core/dev.c:9225:16: warning: declaration shadows a local variable [-Wshadow]
9225 | unsigned int old_flags = dev->flags;
| ^
net/core/dev.c:9185:15: note: previous declaration is here
9185 | unsigned int old_flags = dev->flags;
| ^
1 warning generated.
Remove the redundant inner declaration and reuse the existing old_flags
variable since its value is not needed outside the if block, and it is
safe to reuse the variable. This eliminates the warning while
maintaining the same functionality.
Signed-off-by: Breno Leitao <[email protected]>
Reviewed-by: Mateusz Polchlopek <[email protected]>
Reviewed-by: Kalesh AP <[email protected]>
Reviewed-by: Nicolas Dichtel <[email protected]>
Reviewed-by: Andrew Lunn <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/ipv4/tcp.c')
0 files changed, 0 insertions, 0 deletions
