]> git.baikalelectronics.ru Git - kernel.git/commit
drivers: net: smc911x: Fix set but unused status because of DBG macro
authorAndrew Lunn <andrew@lunn.ch>
Tue, 10 Nov 2020 03:02:45 +0000 (04:02 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Nov 2020 22:49:39 +0000 (14:49 -0800)
commit31522a59f3118e489613bf966f1bdbf28d03735c
tree3cbb13854bdea9d14dc9a52d2a1ca81f83bdb06a
parent494c37f5c833bf702878968053ef4d3c09177593
drivers: net: smc911x: Fix set but unused status because of DBG macro

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]
 1251 |  int status, mask;

The status is read in order to print it via the DBG macro. However,
due to the way DBG is disabled, the compiler never sees it being used.

Change the DBG macro to actually make use of the passed parameters,
and the leave the optimiser to remove the unwanted code inside the
while (0).

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