All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] scsi: fnic: add a space after %p in printf format
@ 2017-12-10 19:23 Nicolas Iooss
  2017-12-11 22:22 ` Bart Van Assche
  2017-12-12  2:43 ` Martin K. Petersen
  0 siblings, 2 replies; 5+ messages in thread
From: Nicolas Iooss @ 2017-12-10 19:23 UTC (permalink / raw)
  To: Satish Kharat, Sesidhar Baddela, Karan Tilak Kumar, linux-scsi
  Cc: linux-kernel, Nicolas Iooss

fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with:

    FNIC_SCSI_DBG(KERN_INFO...
        "... sc = 0x%p"
        "scsi_status ..."
        ...

As the literal strings get merged, the function uses %ps instead of the
intended raw %p format. Fix this by inserting a space.

Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
---
 drivers/scsi/fnic/fnic_scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index 242e2ee494a1..8cbd3c9f0b4c 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -906,7 +906,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
 
 		FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
 			"icmnd_cmpl abts pending "
-			  "hdr status = %s tag = 0x%x sc = 0x%p"
+			  "hdr status = %s tag = 0x%x sc = 0x%p "
 			  "scsi_status = %x residual = %d\n",
 			  fnic_fcpio_status_to_str(hdr_status),
 			  id, sc,
-- 
2.15.0

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

* Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format
  2017-12-10 19:23 [PATCH 1/1] scsi: fnic: add a space after %p in printf format Nicolas Iooss
@ 2017-12-11 22:22 ` Bart Van Assche
  2017-12-11 22:54   ` Nicolas Iooss
  2017-12-12  2:43 ` Martin K. Petersen
  1 sibling, 1 reply; 5+ messages in thread
From: Bart Van Assche @ 2017-12-11 22:22 UTC (permalink / raw)
  To: kartilak, linux-scsi, nicolas.iooss_linux, satishkh, sebaddel
  Cc: linux-kernel

On Sun, 2017-12-10 at 20:23 +0100, Nicolas Iooss wrote:
> fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with:
> 
>     FNIC_SCSI_DBG(KERN_INFO...
>         "... sc = 0x%p"
>         "scsi_status ..."
>         ...
> 
> As the literal strings get merged, the function uses %ps instead of the
> intended raw %p format. Fix this by inserting a space.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
>  drivers/scsi/fnic/fnic_scsi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> index 242e2ee494a1..8cbd3c9f0b4c 100644
> --- a/drivers/scsi/fnic/fnic_scsi.c
> +++ b/drivers/scsi/fnic/fnic_scsi.c
> @@ -906,7 +906,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
>  
>  		FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
>  			"icmnd_cmpl abts pending "
> -			  "hdr status = %s tag = 0x%x sc = 0x%p"
> +			  "hdr status = %s tag = 0x%x sc = 0x%p "
>  			  "scsi_status = %x residual = %d\n",

Since the %p format specifier already inserts a 0x prefix, shouldn't 0x%p be changed
into %p?

Bart.

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

* Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format
  2017-12-11 22:22 ` Bart Van Assche
@ 2017-12-11 22:54   ` Nicolas Iooss
  2017-12-11 23:34     ` Bart Van Assche
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Iooss @ 2017-12-11 22:54 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: kartilak, linux-scsi, satishkh, sebaddel, linux-kernel

On Mon, Dec 11, 2017 at 11:22 PM, Bart Van Assche
<Bart.VanAssche@wdc.com> wrote:
>
> On Sun, 2017-12-10 at 20:23 +0100, Nicolas Iooss wrote:
> > fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with:
> >
> >     FNIC_SCSI_DBG(KERN_INFO...
> >         "... sc = 0x%p"
> >         "scsi_status ..."
> >         ...
> >
> > As the literal strings get merged, the function uses %ps instead of the
> > intended raw %p format. Fix this by inserting a space.
> >
> > Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> > ---
> >  drivers/scsi/fnic/fnic_scsi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
> > index 242e2ee494a1..8cbd3c9f0b4c 100644
> > --- a/drivers/scsi/fnic/fnic_scsi.c
> > +++ b/drivers/scsi/fnic/fnic_scsi.c
> > @@ -906,7 +906,7 @@ static void fnic_fcpio_icmnd_cmpl_handler(struct fnic *fnic,
> >
> >               FNIC_SCSI_DBG(KERN_INFO, fnic->lport->host,
> >                       "icmnd_cmpl abts pending "
> > -                       "hdr status = %s tag = 0x%x sc = 0x%p"
> > +                       "hdr status = %s tag = 0x%x sc = 0x%p "
> >                         "scsi_status = %x residual = %d\n",
>
> Since the %p format specifier already inserts a 0x prefix, shouldn't 0x%p be changed
> into %p?

Does it? On the kernel I use it does not, and the documentation for %p
does not show a 0x prefix
(https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/printk-formats.txt?h=v4.15-rc3#n57).

Nicolas

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

* Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format
  2017-12-11 22:54   ` Nicolas Iooss
@ 2017-12-11 23:34     ` Bart Van Assche
  0 siblings, 0 replies; 5+ messages in thread
From: Bart Van Assche @ 2017-12-11 23:34 UTC (permalink / raw)
  To: nicolas.iooss_linux
  Cc: kartilak, linux-scsi, linux-kernel, satishkh, sebaddel

On Mon, 2017-12-11 at 23:54 +0100, Nicolas Iooss wrote:
> On Mon, Dec 11, 2017 at 11:22 PM, Bart Van Assche
> <Bart.VanAssche@wdc.com> wrote:
> > On Sun, 2017-12-10 at 20:23 +0100, Nicolas Iooss wrote:
> > > -                       "hdr status = %s tag = 0x%x sc = 0x%p"
> > > +                       "hdr status = %s tag = 0x%x sc = 0x%p "
> > >                         "scsi_status = %x residual = %d\n",
> > 
> > Since the %p format specifier already inserts a 0x prefix, shouldn't 0x%p be changed
> > into %p?
> 
> Does it? On the kernel I use it does not, and the documentation for %p
> does not show a 0x prefix
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/printk-formats.txt?h=v4.15-rc3#n57).

Please ignore my comment.

Bart.

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

* Re: [PATCH 1/1] scsi: fnic: add a space after %p in printf format
  2017-12-10 19:23 [PATCH 1/1] scsi: fnic: add a space after %p in printf format Nicolas Iooss
  2017-12-11 22:22 ` Bart Van Assche
@ 2017-12-12  2:43 ` Martin K. Petersen
  1 sibling, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2017-12-12  2:43 UTC (permalink / raw)
  To: Nicolas Iooss
  Cc: Satish Kharat, Sesidhar Baddela, Karan Tilak Kumar, linux-scsi,
	linux-kernel


Nicolas,

> fnic_fcpio_icmnd_cmpl_handler() displays the value of sc with:

> As the literal strings get merged, the function uses %ps instead of the
> intended raw %p format. Fix this by inserting a space.

Applied to 4.16/scsi-queue. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2017-12-12  2:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-10 19:23 [PATCH 1/1] scsi: fnic: add a space after %p in printf format Nicolas Iooss
2017-12-11 22:22 ` Bart Van Assche
2017-12-11 22:54   ` Nicolas Iooss
2017-12-11 23:34     ` Bart Van Assche
2017-12-12  2:43 ` 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.