]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: net: smc911x: Work around set but unused status
authorAndrew Lunn <andrew@lunn.ch>
Tue, 10 Nov 2020 03:02:44 +0000 (04:02 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Nov 2020 22:49:39 +0000 (14:49 -0800)
commit494c37f5c833bf702878968053ef4d3c09177593
treef54fa69957f0be31c9546aefbb2d7d3de361cf30
parentf6473bb849c547b057d02de0141b3cf7dfa6113f
drivers: net: smc911x: Work around set but unused status

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]
  976 |  int status;

A comment indicates the status needs to be read from the PHY,
otherwise bad things happen. But due to the macro magic, it is hard to
perform the read without assigning it to a variable. So add
_always_unused attribute to status to tell the compiler we don't
expect to use the value.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/smsc/smc911x.c