Skip to content

Commit

Permalink
scsi: mvsas: Avoid -Wempty-body warning
Browse files Browse the repository at this point in the history
Building with 'make W=1' shows a few harmless -Wempty-body warning for the
mvsas driver:

drivers/scsi/mvsas/mv_94xx.c: In function 'mvs_94xx_phy_reset':
drivers/scsi/mvsas/mv_94xx.c:278:63: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  278 |                         mv_dprintk("phy hard reset failed.\n");
      |                                                               ^
drivers/scsi/mvsas/mv_sas.c: In function 'mvs_task_prep':
drivers/scsi/mvsas/mv_sas.c:723:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
  723 |                                 SAS_ADDR(dev->sas_addr));
      |                                                         ^

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

Link: https://lore.kernel.org/r/20210322103316.620694-1-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Arnd Bergmann authored and Martin K. Petersen committed Apr 2, 2021
1 parent 472c1cf commit ae3645d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/mvsas/mv_sas.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#define mv_dprintk(format, arg...) \
printk(KERN_DEBUG"%s %d:" format, __FILE__, __LINE__, ## arg)
#else
#define mv_dprintk(format, arg...)
#define mv_dprintk(format, arg...) no_printk(format, ## arg)
#endif
#define MV_MAX_U32 0xffffffff

Expand Down

0 comments on commit ae3645d

Please sign in to comment.