Skip to contentSkip to conversation

Fix a compiler warning triggered by the SCSI logging code

PATCH Applied Bart Van Assche 2 participants 2 messages Dec 9, 2019 – Dec 19, 2019 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix a compiler warning triggered by the SCSI logging code

This patch fixes the following compiler warning:

In file included from drivers/scsi/scsi_error.c:46:
drivers/scsi/scsi_error.c: In function 'scsi_eh_target_reset':
drivers/scsi/scsi_logging.h:65:81: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
65 | LOGGING(SCSI_LOG_ERROR_SHIFT, SCSI_LOG_ERROR_BITS, LEVEL,CMD);
| ^

drivers/scsi/scsi_error.c:1562:4: note: in expansion of macro 'SCSI_LOG_ERROR_RECOVERY'

 1562 |    SCSI_LOG_ERROR_RECOVERY(3,
      |    ^~~~~~~~~~~~~~~~~~~~~~~
---
 drivers/scsi/scsi_logging.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_logging.h +1 -1
index 836185de28c4..3df877886119 100644
@@ -53,7 +53,7 @@ do {								\
 } while (0)
 #else
 #define SCSI_LOG_LEVEL(SHIFT, BITS) 0
-#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD)
+#define SCSI_CHECK_LOGGING(SHIFT, BITS, LEVEL, CMD) do { } while (0)
 #endif /* CONFIG_SCSI_LOGGING */
 
 /*
#1 lore raw

Bart,

Quoted 7 lines

This patch fixes the following compiler warning:

In file included from drivers/scsi/scsi_error.c:46:
drivers/scsi/scsi_error.c: In function 'scsi_eh_target_reset':
drivers/scsi/scsi_logging.h:65:81: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
65 | LOGGING(SCSI_LOG_ERROR_SHIFT, SCSI_LOG_ERROR_BITS, LEVEL,CMD);
| ^

Applied to 5.6/scsi-queue, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering