netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net/velocity: fix -Wunused-but-set-variable warnings
@ 2019-10-04  4:52 Austin Kim
  2019-10-04 22:10 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Austin Kim @ 2019-10-04  4:52 UTC (permalink / raw)
  To: romieu, davem; +Cc: netdev, linux-kernel, austindh.kim

'curr_status' is declared as u32.
But this variable is not used after below statement.
   curr_status = vptr->mii_status & (~VELOCITY_LINK_FAIL);

This variable could be dropped to mute below warning message:

   drivers/net/ethernet/via/via-velocity.c:868:6:
   warning: variable ‘curr_status’ set but not used 
   [-Wunused-but-set-variable]

Signed-off-by: Austin Kim <austindh.kim@gmail.com>
---
 drivers/net/ethernet/via/via-velocity.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
index 346e441..36d402c 100644
--- a/drivers/net/ethernet/via/via-velocity.c
+++ b/drivers/net/ethernet/via/via-velocity.c
@@ -865,11 +865,9 @@ static u32 check_connection_type(struct mac_regs __iomem *regs)
  */
 static int velocity_set_media_mode(struct velocity_info *vptr, u32 mii_status)
 {
-	u32 curr_status;
 	struct mac_regs __iomem *regs = vptr->mac_regs;
 
 	vptr->mii_status = mii_check_media_mode(vptr->mac_regs);
-	curr_status = vptr->mii_status & (~VELOCITY_LINK_FAIL);
 
 	/* Set mii link status */
 	set_mii_flow_control(vptr);
-- 
2.6.2


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

* Re: [PATCH] net/velocity: fix -Wunused-but-set-variable warnings
  2019-10-04  4:52 [PATCH] net/velocity: fix -Wunused-but-set-variable warnings Austin Kim
@ 2019-10-04 22:10 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-10-04 22:10 UTC (permalink / raw)
  To: austindh.kim; +Cc: romieu, netdev, linux-kernel

From: Austin Kim <austindh.kim@gmail.com>
Date: Fri, 4 Oct 2019 13:52:03 +0900

> 'curr_status' is declared as u32.
> But this variable is not used after below statement.
>    curr_status = vptr->mii_status & (~VELOCITY_LINK_FAIL);
> 
> This variable could be dropped to mute below warning message:
> 
>    drivers/net/ethernet/via/via-velocity.c:868:6:
>    warning: variable ‘curr_status’ set but not used 
>    [-Wunused-but-set-variable]
> 
> Signed-off-by: Austin Kim <austindh.kim@gmail.com>

Please don't make these changes like a robot.

Always look at the surrounding context and even the history of how
this piece of code got here by using git blame and other tools.

There is a comment right under this variable assignment referring to
the variable.  So if you remove the variable, you should do something
with the comment as well.

Thank you.

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

end of thread, other threads:[~2019-10-04 22:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04  4:52 [PATCH] net/velocity: fix -Wunused-but-set-variable warnings Austin Kim
2019-10-04 22:10 ` David Miller

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).