netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: ksz884x: remove unused change variable
@ 2023-03-29 12:59 Tom Rix
  2023-03-29 13:23 ` Simon Horman
  2023-03-31  6:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Rix @ 2023-03-29 12:59 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, nathan, ndesaulniers, petrm, leon,
	shayagr, wsa+renesas, yangyingliang
  Cc: netdev, linux-kernel, llvm, Tom Rix

clang with W=1 reports
drivers/net/ethernet/micrel/ksz884x.c:3216:6: error: variable
  'change' set but not used [-Werror,-Wunused-but-set-variable]
        int change = 0;
            ^
This variable is not used so remove it.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/ethernet/micrel/ksz884x.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/micrel/ksz884x.c b/drivers/net/ethernet/micrel/ksz884x.c
index e6acd1e7b263..f78e8ead8c36 100644
--- a/drivers/net/ethernet/micrel/ksz884x.c
+++ b/drivers/net/ethernet/micrel/ksz884x.c
@@ -3213,7 +3213,6 @@ static void port_get_link_speed(struct ksz_port *port)
 	u8 remote;
 	int i;
 	int p;
-	int change = 0;
 
 	interrupt = hw_block_intr(hw);
 
@@ -3260,17 +3259,14 @@ static void port_get_link_speed(struct ksz_port *port)
 					port_cfg_back_pressure(hw, p,
 						(1 == info->duplex));
 				}
-				change |= 1 << i;
 				port_cfg_change(hw, port, info, status);
 			}
 			info->state = media_connected;
 		} else {
-			if (media_disconnected != info->state) {
-				change |= 1 << i;
-
-				/* Indicate the link just goes down. */
+			/* Indicate the link just goes down. */
+			if (media_disconnected != info->state)
 				hw->port_mib[p].link_down = 1;
-			}
+
 			info->state = media_disconnected;
 		}
 		hw->port_mib[p].state = (u8) info->state;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ksz884x: remove unused change variable
  2023-03-29 12:59 [PATCH] net: ksz884x: remove unused change variable Tom Rix
@ 2023-03-29 13:23 ` Simon Horman
  2023-03-29 13:41   ` Simon Horman
  2023-03-31  6:30 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Horman @ 2023-03-29 13:23 UTC (permalink / raw)
  To: Tom Rix
  Cc: davem, edumazet, kuba, pabeni, nathan, ndesaulniers, petrm, leon,
	shayagr, wsa+renesas, yangyingliang, netdev, linux-kernel, llvm

On Wed, Mar 29, 2023 at 08:59:29AM -0400, Tom Rix wrote:
> clang with W=1 reports
> drivers/net/ethernet/micrel/ksz884x.c:3216:6: error: variable
>   'change' set but not used [-Werror,-Wunused-but-set-variable]
>         int change = 0;
>             ^
> This variable is not used so remove it.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Simon Horman <simon.horman@corigine.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ksz884x: remove unused change variable
  2023-03-29 13:23 ` Simon Horman
@ 2023-03-29 13:41   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-03-29 13:41 UTC (permalink / raw)
  To: Tom Rix
  Cc: davem, edumazet, kuba, pabeni, nathan, ndesaulniers, petrm, leon,
	shayagr, wsa+renesas, yangyingliang, netdev, linux-kernel, llvm

On Wed, Mar 29, 2023 at 03:23:38PM +0200, Simon Horman wrote:
> On Wed, Mar 29, 2023 at 08:59:29AM -0400, Tom Rix wrote:
> > clang with W=1 reports
> > drivers/net/ethernet/micrel/ksz884x.c:3216:6: error: variable
> >   'change' set but not used [-Werror,-Wunused-but-set-variable]
> >         int change = 0;
> >             ^
> > This variable is not used so remove it.
> > 
> > Signed-off-by: Tom Rix <trix@redhat.com>
> 
> Reviewed-by: Simon Horman <simon.horman@corigine.com>

Hi Tom,

I notice a very large number of unused functions in ksz884x.c.
And I think this means some corresponding #defines can also be removed.

I'm wondering if you happen to be looking at this.
If not, I'll see about preparing a patch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] net: ksz884x: remove unused change variable
  2023-03-29 12:59 [PATCH] net: ksz884x: remove unused change variable Tom Rix
  2023-03-29 13:23 ` Simon Horman
@ 2023-03-31  6:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-03-31  6:30 UTC (permalink / raw)
  To: Tom Rix
  Cc: davem, edumazet, kuba, pabeni, nathan, ndesaulniers, petrm, leon,
	shayagr, wsa+renesas, yangyingliang, netdev, linux-kernel, llvm

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed, 29 Mar 2023 08:59:29 -0400 you wrote:
> clang with W=1 reports
> drivers/net/ethernet/micrel/ksz884x.c:3216:6: error: variable
>   'change' set but not used [-Werror,-Wunused-but-set-variable]
>         int change = 0;
>             ^
> This variable is not used so remove it.
> 
> [...]

Here is the summary with links:
  - net: ksz884x: remove unused change variable
    https://git.kernel.org/netdev/net-next/c/9a865a98a336

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-31  6:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-29 12:59 [PATCH] net: ksz884x: remove unused change variable Tom Rix
2023-03-29 13:23 ` Simon Horman
2023-03-29 13:41   ` Simon Horman
2023-03-31  6:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).