linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] scsi: Fix warning: zero-length gnu_printf format string
@ 2010-08-25 23:55 Jean Sacren
  2010-08-25 23:58 ` [PATCH 1/1] " Jean Sacren
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Sacren @ 2010-08-25 23:55 UTC (permalink / raw)
  To: Linux SCSI Mailing List

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(-)


-- 
Jean Sacren
Bring LAMP To People

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

* [PATCH 1/1] scsi: Fix warning: zero-length gnu_printf format string
  2010-08-25 23:55 [PATCH 0/1] scsi: Fix warning: zero-length gnu_printf format string Jean Sacren
@ 2010-08-25 23:58 ` Jean Sacren
  2010-08-26  6:00   ` Bart Van Assche
  0 siblings, 1 reply; 4+ messages in thread
From: Jean Sacren @ 2010-08-25 23:58 UTC (permalink / raw)
  To: Linux SCSI Mailing List

warning: zero-length gnu_printf format string

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

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
---
 drivers/scsi/constants.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index cd05e04..d0c8234 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -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);
-- 
1.7.1


-- 
Jean Sacren
Bring LAMP To People

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

* Re: [PATCH 1/1] scsi: Fix warning: zero-length gnu_printf format string
  2010-08-25 23:58 ` [PATCH 1/1] " Jean Sacren
@ 2010-08-26  6:00   ` Bart Van Assche
  2010-08-26 14:28     ` James Bottomley
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Van Assche @ 2010-08-26  6:00 UTC (permalink / raw)
  To: Jean Sacren; +Cc: Linux SCSI Mailing List

On Thu, Aug 26, 2010 at 1:58 AM, Jean Sacren <sakiwit@gmail.com> wrote:
>
> warning: zero-length gnu_printf format string
>
> Fix the above warning by inserting a space into the literal string.
[ ... ]
> -       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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/1] scsi: Fix warning: zero-length gnu_printf format string
  2010-08-26  6:00   ` Bart Van Assche
@ 2010-08-26 14:28     ` James Bottomley
  0 siblings, 0 replies; 4+ messages in thread
From: James Bottomley @ 2010-08-26 14:28 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: Jean Sacren, Linux SCSI Mailing List

On Thu, 2010-08-26 at 08:00 +0200, Bart Van Assche wrote:
> On Thu, Aug 26, 2010 at 1:58 AM, Jean Sacren <sakiwit@gmail.com> wrote:
> >
> > warning: zero-length gnu_printf format string
> >
> > Fix the above warning by inserting a space into the literal string.
> [ ... ]
> > -       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



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

end of thread, other threads:[~2010-08-26 14:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-25 23:55 [PATCH 0/1] scsi: Fix warning: zero-length gnu_printf format string Jean Sacren
2010-08-25 23:58 ` [PATCH 1/1] " Jean Sacren
2010-08-26  6:00   ` Bart Van Assche
2010-08-26 14:28     ` James Bottomley

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).