diff mbox series

[02/12] net: ethernet: smsc: smc911x: Mark 'status' as __maybe_unused

Message ID 20201104090610.1446616-3-lee.jones@linaro.org
State New
Headers show
Series Rid W=1 warnings in Net | expand

Commit Message

Lee Jones Nov. 4, 2020, 9:06 a.m. UTC
'status' is used to interact with a hardware register.  It might not
be safe to remove it entirely.  Mark it as __maybe_unused instead.

Fixes the following W=1 kernel build warning(s):

 drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_phy_configure’:
 drivers/net/ethernet/smsc/smc911x.c:882:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
 drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_phy_interrupt’:
 drivers/net/ethernet/smsc/smc911x.c:976:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]
 drivers/net/ethernet/smsc/smc911x.c: In function ‘smc911x_timeout’:
 drivers/net/ethernet/smsc/smc911x.c:1251:6: warning: variable ‘status’ set but not used [-Wunused-but-set-variable]

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Dustin McIntire <dustin@sensoria.com>
Cc: netdev@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/net/ethernet/smsc/smc911x.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.25.1

Comments

Andrew Lunn Nov. 4, 2020, 1:22 p.m. UTC | #1
On Wed, Nov 04, 2020 at 09:06:00AM +0000, Lee Jones wrote:
> 'status' is used to interact with a hardware register.  It might not

> be safe to remove it entirely.  Mark it as __maybe_unused instead.


Hi Lee

https://www.mail-archive.com/netdev@vger.kernel.org/msg365875.html

I'm working on driver/net/ethernet and net to make it w=1 clean.  I
suggest you hang out on the netdev mailing list so you don't waste
your time reproducing what i am doing.

     Andrew
Lee Jones Nov. 4, 2020, 2:31 p.m. UTC | #2
On Wed, 04 Nov 2020, Andrew Lunn wrote:

> On Wed, Nov 04, 2020 at 09:06:00AM +0000, Lee Jones wrote:

> > 'status' is used to interact with a hardware register.  It might not

> > be safe to remove it entirely.  Mark it as __maybe_unused instead.

> 

> Hi Lee

> 

> https://www.mail-archive.com/netdev@vger.kernel.org/msg365875.html

> 

> I'm working on driver/net/ethernet and net to make it w=1 clean.  I

> suggest you hang out on the netdev mailing list so you don't waste

> your time reproducing what i am doing.


I believe that ship has sailed.  Net should be clean now.

It was it pretty good shape considering.  Only 2 sets.

Wireless alone was more like 4.  And SCSI, well ... :D

Maybe that was down to some of your previous efforts? 

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Lee Jones Nov. 4, 2020, 2:38 p.m. UTC | #3
On Wed, 04 Nov 2020, Lee Jones wrote:

> On Wed, 04 Nov 2020, Andrew Lunn wrote:

> 

> > On Wed, Nov 04, 2020 at 09:06:00AM +0000, Lee Jones wrote:

> > > 'status' is used to interact with a hardware register.  It might not

> > > be safe to remove it entirely.  Mark it as __maybe_unused instead.

> > 

> > Hi Lee

> > 

> > https://www.mail-archive.com/netdev@vger.kernel.org/msg365875.html

> > 

> > I'm working on driver/net/ethernet and net to make it w=1 clean.  I

> > suggest you hang out on the netdev mailing list so you don't waste

> > your time reproducing what i am doing.

> 

> I believe that ship has sailed.  Net should be clean now.

> 

> It was it pretty good shape considering.  Only 2 sets.

> 

> Wireless alone was more like 4.  And SCSI, well ... :D

> 

> Maybe that was down to some of your previous efforts? 


Our of interest, are you planning on working on any other areas?

I'm slowly working my way through the whole kernel.

Completed so far:

 - ASoC
 - backlight
 - cpufreq
 - crypto
 - dmaengine
 - gpio
 - hwmon
 - iio
 - input
 - mfd
 - misc
 - mmc
 - mtd
 - net
 - pinctrl
 - pwm
 - regulator
 - remoteproc
 - scsi
 - soc
 - spi
 - tty
 - usb
 - wireless 

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Andrew Lunn Nov. 4, 2020, 2:45 p.m. UTC | #4
On Wed, Nov 04, 2020 at 02:31:40PM +0000, Lee Jones wrote:
> On Wed, 04 Nov 2020, Andrew Lunn wrote:

> 

> > On Wed, Nov 04, 2020 at 09:06:00AM +0000, Lee Jones wrote:

> > > 'status' is used to interact with a hardware register.  It might not

> > > be safe to remove it entirely.  Mark it as __maybe_unused instead.

> > 

> > Hi Lee

> > 

> > https://www.mail-archive.com/netdev@vger.kernel.org/msg365875.html

> > 

> > I'm working on driver/net/ethernet and net to make it w=1 clean.  I

> > suggest you hang out on the netdev mailing list so you don't waste

> > your time reproducing what i am doing.

> 

> I believe that ship has sailed.  Net should be clean now.


drivers/net is getting better, but is not clean. I have some patches
from Arnd which allow W=1 to be enabled by default for subdirectories,
and i have to skip a few. Also net, not driver/net has problems, which
i'm working on. I hope Arnd will post his patches soon, so we can get
them merged and prevent regressions with W=1.

> Maybe that was down to some of your previous efforts? 


And Jakub running a bot which compile tests all new patches with W=1.

    Andrew
Andrew Lunn Nov. 4, 2020, 2:47 p.m. UTC | #5
> Our of interest, are you planning on working on any other areas?


Hi Lee.

No, not really. I'm a networking guy, so will look mostly at
drivers/net and the core net code.

    Andrew
diff mbox series

Patch

diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 01069dfaf75c9..552953c376fe3 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -879,7 +879,7 @@  static void smc911x_phy_configure(struct work_struct *work)
 	int phyaddr = lp->mii.phy_id;
 	int my_phy_caps; /* My PHY capabilities */
 	int my_ad_caps; /* My Advertised capabilities */
-	int status;
+	int __maybe_unused status;
 	unsigned long flags;
 
 	DBG(SMC_DEBUG_FUNC, dev, "--> %s()\n", __func__);
@@ -973,7 +973,7 @@  static void smc911x_phy_interrupt(struct net_device *dev)
 {
 	struct smc911x_local *lp = netdev_priv(dev);
 	int phyaddr = lp->mii.phy_id;
-	int status;
+	int __maybe_unused status;
 
 	DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);
 
@@ -1248,7 +1248,7 @@  static void smc911x_poll_controller(struct net_device *dev)
 static void smc911x_timeout(struct net_device *dev, unsigned int txqueue)
 {
 	struct smc911x_local *lp = netdev_priv(dev);
-	int status, mask;
+	int __maybe_unused status, mask;
 	unsigned long flags;
 
 	DBG(SMC_DEBUG_FUNC, dev, "--> %s\n", __func__);