diff mbox series

[1/2] aic94xx: avoid -Wempty-body warning

Message ID 20210322102549.278661-1-arnd@kernel.org
State New
Headers show
Series [1/2] aic94xx: avoid -Wempty-body warning | expand

Commit Message

Arnd Bergmann March 22, 2021, 10:25 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>


Building with 'make W=1' shows a harmless -Wempty-body warning:

drivers/scsi/aic94xx/aic94xx_init.c: In function 'asd_free_queues':
drivers/scsi/aic94xx/aic94xx_init.c:858:62: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  858 |                 ASD_DPRINTK("Uh-oh! Pending is not empty!\n");

Change the empty ASD_DPRINTK() macro to no_printk(), which avoids this
warning and adds format string checking.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/scsi/aic94xx/aic94xx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.29.2

Comments

Martin K. Petersen April 6, 2021, 4:53 a.m. UTC | #1
On Mon, 22 Mar 2021 11:25:43 +0100, Arnd Bergmann wrote:

> Building with 'make W=1' shows a harmless -Wempty-body warning:

> 

> drivers/scsi/aic94xx/aic94xx_init.c: In function 'asd_free_queues':

> drivers/scsi/aic94xx/aic94xx_init.c:858:62: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]

>   858 |                 ASD_DPRINTK("Uh-oh! Pending is not empty!\n");

> 

> Change the empty ASD_DPRINTK() macro to no_printk(), which avoids this

> warning and adds format string checking.


Applied to 5.13/scsi-queue, thanks!

[1/2] aic94xx: avoid -Wempty-body warning
      https://git.kernel.org/mkp/scsi/c/6c26379def09
[2/2] scsi: message: fusion: avoid -Wempty-body warnings
      https://git.kernel.org/mkp/scsi/c/472c1cfb10f1

-- 
Martin K. Petersen	Oracle Linux Engineering
diff mbox series

Patch

diff --git a/drivers/scsi/aic94xx/aic94xx.h b/drivers/scsi/aic94xx/aic94xx.h
index 98978bc199ff..8f24180646c2 100644
--- a/drivers/scsi/aic94xx/aic94xx.h
+++ b/drivers/scsi/aic94xx/aic94xx.h
@@ -33,7 +33,7 @@ 
 #ifdef ASD_DEBUG
 #define ASD_DPRINTK asd_printk
 #else
-#define ASD_DPRINTK(fmt, ...)
+#define ASD_DPRINTK(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
 #endif
 
 /* 2*ITNL timeout + 1 second */