Skip to contentSkip to conversation

scsi: Fix warning: zero-length gnu_printf format string

PATCH In review Jean Sacren 3 participants 4 messages Aug 25, 2010 – Aug 26, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

cover scsi: Fix warning: zero-length gnu_printf format string

Hi,

Jean Sacren (1):
scsi: Fix warning: zero-length gnu_printf format string

 drivers/scsi/constants.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Signature · 2 lines
Jean Sacren
Bring LAMP To People
#1 lore raw

PATCH 1/1 scsi: Fix warning: zero-length gnu_printf format string

warning: zero-length gnu_printf format string

Fix the above warning by inserting a space into the literal string.

---
 drivers/scsi/constants.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/constants.c +3 -3
index cd05e04..d0c8234 100644
@@ -1404,13 +1404,13 @@ void scsi_print_sense(char *name, struct scsi_cmnd *cmd)
 {
 	struct scsi_sense_hdr sshdr;
 
-	scmd_printk(KERN_INFO, cmd, "");
+	scmd_printk(KERN_INFO, cmd, " ");
 	scsi_decode_sense_buffer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
 				 &sshdr);
 	scsi_show_sense_hdr(&sshdr);
 	scsi_decode_sense_extras(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
 				 &sshdr);
-	scmd_printk(KERN_INFO, cmd, "");
+	scmd_printk(KERN_INFO, cmd, " ");
 	scsi_show_extd_sense(sshdr.asc, sshdr.ascq);
 }
 EXPORT_SYMBOL(scsi_print_sense);
@@ -1453,7 +1453,7 @@ EXPORT_SYMBOL(scsi_show_result);
 
 void scsi_print_result(struct scsi_cmnd *cmd)
 {
-	scmd_printk(KERN_INFO, cmd, "");
+	scmd_printk(KERN_INFO, cmd, " ");
 	scsi_show_result(cmd->result);
 }
 EXPORT_SYMBOL(scsi_print_result);
Signature · 6 lines
1.7.1


-- 
Jean Sacren
Bring LAMP To People
#2 lore raw
Quoted 4 lines · Jean Sacren

warning: zero-length gnu_printf format string

Fix the above warning by inserting a space into the literal string.

[ ... ]

Quoted 2 lines

-       scmd_printk(KERN_INFO, cmd, "");
+       scmd_printk(KERN_INFO, cmd, " ");

Hello Jean,

Have you considered to replace the empty string by "%s", "" or to submit a patch that disables the compiler warning on empty format strings ?

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
Quoted 6 lines · Bart Van Assche
Quoted 4 lines · Jean Sacren

warning: zero-length gnu_printf format string

Fix the above warning by inserting a space into the literal string.

[ ... ]

Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +1 -1
-       scmd_printk(KERN_INFO, cmd, "");
+       scmd_printk(KERN_INFO, cmd, " ");

Hello Jean,

Have you considered to replace the empty string by "%s", "" or to submit a patch that disables the compiler warning on empty format strings ?

Actually, I wouldn't do that. The warning is controversial and recently introduced. Proposing a patch to disable it would step into a fairly huge controversy. The patch as is, looks fine ... it's basically what I asked of the people who did the conversion, but they contaminated their patch with a lot of unnecessary cruft, so I'll take this one.

James