From: Andrew Lunn Date: Tue, 10 Nov 2020 03:02:45 +0000 (+0100) Subject: drivers: net: smc911x: Fix set but unused status because of DBG macro X-Git-Tag: accepted/tizen/unified/20230118.172025~8321^2~275^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40f6d1d9159b920e7b2722375506ecf86c633b95;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c index 8f748a0..6978050 100644 --- a/drivers/net/ethernet/smsc/smc911x.c +++ b/drivers/net/ethernet/smsc/smc911x.c @@ -102,7 +102,10 @@ MODULE_ALIAS("platform:smc911x"); #define PRINTK(dev, args...) netdev_info(dev, args) #else -#define DBG(n, dev, args...) do { } while (0) +#define DBG(n, dev, args...) \ + while (0) { \ + netdev_dbg(dev, args); \ + } #define PRINTK(dev, args...) netdev_dbg(dev, args) #endif