linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target: pscsi: avoid Wempty-body warning
@ 2021-03-22 11:44 Arnd Bergmann
  2021-03-22 15:47 ` Christoph Hellwig
  2021-03-22 16:06 ` Matthew Wilcox
  0 siblings, 2 replies; 9+ messages in thread
From: Arnd Bergmann @ 2021-03-22 11:44 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Arnd Bergmann, Jens Axboe, Chaitanya Kulkarni, Hannes Reinecke,
	Bodo Stroesser, Matthew Wilcox (Oracle),
	Guoqing Jiang, linux-scsi, target-devel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Building with 'make W=1' shows a harmless warning for pscsi:

drivers/target/target_core_pscsi.c: In function 'pscsi_complete_cmd':
drivers/target/target_core_pscsi.c:624:33: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
  624 |                                 ; /* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */
      |                                 ^

Rework the coding style as suggested by gcc to avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/target/target_core_pscsi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
index 3cbc074992bc..913b092955f6 100644
--- a/drivers/target/target_core_pscsi.c
+++ b/drivers/target/target_core_pscsi.c
@@ -620,8 +620,9 @@ static void pscsi_complete_cmd(struct se_cmd *cmd, u8 scsi_status,
 			unsigned char *buf;
 
 			buf = transport_kmap_data_sg(cmd);
-			if (!buf)
-				; /* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */
+			if (!buf) {
+				/* XXX: TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE */
+			}
 
 			if (cdb[0] == MODE_SENSE_10) {
 				if (!(buf[3] & 0x80))
-- 
2.29.2


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

end of thread, other threads:[~2021-03-23 17:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 11:44 [PATCH] target: pscsi: avoid Wempty-body warning Arnd Bergmann
2021-03-22 15:47 ` Christoph Hellwig
2021-03-22 15:53   ` Willy Tarreau
2021-03-22 16:18     ` Arnd Bergmann
2021-03-22 16:26       ` Willy Tarreau
2021-03-22 16:34         ` Arnd Bergmann
2021-03-22 16:38           ` Willy Tarreau
2021-03-23 17:24         ` David Laight
2021-03-22 16:06 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).