All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mvsas: avoid -Wempty-body warning
@ 2021-03-22 10:33 Arnd Bergmann
  2021-04-06  4:53 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-03-22 10:33 UTC (permalink / raw)
  To: James E.J. Bottomley, Martin K. Petersen
  Cc: Arnd Bergmann, linux-scsi, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/mvsas/mv_sas.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/mvsas/mv_sas.h b/drivers/scsi/mvsas/mv_sas.h
index 327fdd5ee962..8ff976c9967e 100644
--- a/drivers/scsi/mvsas/mv_sas.h
+++ b/drivers/scsi/mvsas/mv_sas.h
@@ -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
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mvsas: avoid -Wempty-body warning
  2021-03-22 10:33 [PATCH] mvsas: avoid -Wempty-body warning Arnd Bergmann
@ 2021-04-06  4:53 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2021-04-06  4:53 UTC (permalink / raw)
  To: Arnd Bergmann, James E.J. Bottomley
  Cc: Martin K . Petersen, linux-scsi, Arnd Bergmann, linux-kernel

On Mon, 22 Mar 2021 11:33:09 +0100, Arnd Bergmann wrote:

> 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));
>       |                                                         ^
> 
> [...]

Applied to 5.13/scsi-queue, thanks!

[1/1] mvsas: avoid -Wempty-body warning
      https://git.kernel.org/mkp/scsi/c/ae3645d29d4e

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-06  4:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 10:33 [PATCH] mvsas: avoid -Wempty-body warning Arnd Bergmann
2021-04-06  4:53 ` Martin K. Petersen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.