public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lpfc: nvmet_fc: fix format string
@ 2017-05-19  8:04 Arnd Bergmann
  2017-05-20 10:28 ` Joe Perches
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Arnd Bergmann @ 2017-05-19  8:04 UTC (permalink / raw)
  To: James Smart, Dick Kennedy
  Cc: Arnd Bergmann, James E.J. Bottomley, Martin K. Petersen,
	Hannes Reinecke, Johannes Thumshirn, linux-scsi, linux-kernel

The lpfc_nvmeio_data() tracing helper always takes a format string and
three additional arguments. The latest caller has a format string with
only two integer arguments, causing this harmless warning:

drivers/scsi/lpfc/lpfc_nvmet.c: In function 'lpfc_nvmet_xmt_fcp_release':
drivers/scsi/lpfc/lpfc_nvmet.c:802:25: error: too many arguments for format [-Werror=format-extra-args]
  lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d\n", ctxp->oxid,

We could add a dummy argument here, but it seems reasonable to print
the 'abort' flag as the third argument.

Fixes: 19b58d9473e8 ("nvmet_fc: add req_release to lldd api")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/scsi/lpfc/lpfc_nvmet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index f94294b77b7b..24d54dd016d4 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -799,8 +799,8 @@ lpfc_nvmet_xmt_fcp_release(struct nvmet_fc_target_port *tgtport,
 	}
 	spin_unlock_irqrestore(&ctxp->ctxlock, flags);
 
-	lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d\n", ctxp->oxid,
-			 ctxp->state, 0);
+	lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d abt %d\n", ctxp->oxid,
+			 ctxp->state, aborting);
 
 	atomic_inc(&lpfc_nvmep->xmt_fcp_release);
 
-- 
2.9.0

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

* Re: [PATCH] lpfc: nvmet_fc: fix format string
  2017-05-19  8:04 [PATCH] lpfc: nvmet_fc: fix format string Arnd Bergmann
@ 2017-05-20 10:28 ` Joe Perches
  2017-05-20 19:10   ` Arnd Bergmann
  2017-05-24  2:36 ` Martin K. Petersen
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Joe Perches @ 2017-05-20 10:28 UTC (permalink / raw)
  To: Arnd Bergmann, James Smart, Dick Kennedy
  Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke,
	Johannes Thumshirn, linux-scsi, linux-kernel

On Fri, 2017-05-19 at 10:04 +0200, Arnd Bergmann wrote:
> The lpfc_nvmeio_data() tracing helper always takes a format string and
> three additional arguments.

No it doesn't.  It takes a format and arguments.

I don't disagree with the patch, just the characterization
of the lpfc_mvmeio_data call in the commit message.

> The latest caller has a format string with
> only two integer arguments, causing this harmless warning:
> 
> drivers/scsi/lpfc/lpfc_nvmet.c: In function 'lpfc_nvmet_xmt_fcp_release':
> drivers/scsi/lpfc/lpfc_nvmet.c:802:25: error: too many arguments for format [-Werror=format-extra-args]
>   lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d\n", ctxp->oxid,
> 
> We could add a dummy argument here, but it seems reasonable to print
> the 'abort' flag as the third argument.

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

* Re: [PATCH] lpfc: nvmet_fc: fix format string
  2017-05-20 10:28 ` Joe Perches
@ 2017-05-20 19:10   ` Arnd Bergmann
  2017-05-21  0:43     ` Joe Perches
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2017-05-20 19:10 UTC (permalink / raw)
  To: Joe Perches
  Cc: James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn,
	linux-scsi, Linux Kernel Mailing List

On Sat, May 20, 2017 at 12:28 PM, Joe Perches <joe@perches.com> wrote:
> On Fri, 2017-05-19 at 10:04 +0200, Arnd Bergmann wrote:
>> The lpfc_nvmeio_data() tracing helper always takes a format string and
>> three additional arguments.
>
> No it doesn't.  It takes a format and arguments.
>
> I don't disagree with the patch, just the characterization
> of the lpfc_mvmeio_data call in the commit message.

I think my description is correct, it's just not obvious from
reading the code until you also look at the lpfc_debugfs_nvme_trc
prototype:

extern void lpfc_debugfs_nvme_trc(struct lpfc_hba *phba, char *fmt,
                                uint16_t data1, uint16_t data2, uint32_t data3);
#define lpfc_nvmeio_data(phba, fmt, arg...) \
        { \
        if (phba->nvmeio_trc_on) \
                lpfc_debugfs_nvme_trc(phba, fmt, ##arg); \
        }


This is trying to do the same thing as the regular Linux tracepoints,
but is called in a lot of places that are all required to pass exactly
three integer arguments along with a matching format string.

      Arnd

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

* Re: [PATCH] lpfc: nvmet_fc: fix format string
  2017-05-20 19:10   ` Arnd Bergmann
@ 2017-05-21  0:43     ` Joe Perches
  0 siblings, 0 replies; 7+ messages in thread
From: Joe Perches @ 2017-05-21  0:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn,
	linux-scsi, Linux Kernel Mailing List

On Sat, 2017-05-20 at 21:10 +0200, Arnd Bergmann wrote:
> On Sat, May 20, 2017 at 12:28 PM, Joe Perches <joe@perches.com> wrote:
> > On Fri, 2017-05-19 at 10:04 +0200, Arnd Bergmann wrote:
> > > The lpfc_nvmeio_data() tracing helper always takes a format string and
> > > three additional arguments.
> > 
> > No it doesn't.  It takes a format and arguments.
> > 
> > I don't disagree with the patch, just the characterization
> > of the lpfc_mvmeio_data call in the commit message.
> 
> I think my description is correct, it's just not obvious from
> reading the code until you also look at the lpfc_debugfs_nvme_trc
> prototype:

OK, but more that's a mismatch between a function and its
arguments and a different called function within it.

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

* Re: [PATCH] lpfc: nvmet_fc: fix format string
  2017-05-19  8:04 [PATCH] lpfc: nvmet_fc: fix format string Arnd Bergmann
  2017-05-20 10:28 ` Joe Perches
@ 2017-05-24  2:36 ` Martin K. Petersen
  2017-05-29 23:02 ` James Smart
  2017-06-01  2:44 ` Martin K. Petersen
  3 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2017-05-24  2:36 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn,
	linux-scsi, linux-kernel


Arnd,

> The lpfc_nvmeio_data() tracing helper always takes a format string and
> three additional arguments. The latest caller has a format string with
> only two integer arguments, causing this harmless warning:

James?

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] lpfc: nvmet_fc: fix format string
  2017-05-19  8:04 [PATCH] lpfc: nvmet_fc: fix format string Arnd Bergmann
  2017-05-20 10:28 ` Joe Perches
  2017-05-24  2:36 ` Martin K. Petersen
@ 2017-05-29 23:02 ` James Smart
  2017-06-01  2:44 ` Martin K. Petersen
  3 siblings, 0 replies; 7+ messages in thread
From: James Smart @ 2017-05-29 23:02 UTC (permalink / raw)
  To: Arnd Bergmann, Dick Kennedy
  Cc: James E.J. Bottomley, Martin K. Petersen, Hannes Reinecke,
	Johannes Thumshirn, linux-scsi, linux-kernel

Patch is fine.

Signed-off-by: James Smart <james.smart@broadcom.com>

-- james


On 5/19/2017 1:04 AM, Arnd Bergmann wrote:
> The lpfc_nvmeio_data() tracing helper always takes a format string and
> three additional arguments. The latest caller has a format string with
> only two integer arguments, causing this harmless warning:
>
> drivers/scsi/lpfc/lpfc_nvmet.c: In function 'lpfc_nvmet_xmt_fcp_release':
> drivers/scsi/lpfc/lpfc_nvmet.c:802:25: error: too many arguments for format [-Werror=format-extra-args]
>    lpfc_nvmeio_data(phba, "NVMET FCP FREE: xri x%x ste %d\n", ctxp->oxid,
>
> We could add a dummy argument here, but it seems reasonable to print
> the 'abort' flag as the third argument.
>
> Fixes: 19b58d9473e8 ("nvmet_fc: add req_release to lldd api")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>

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

* Re: [PATCH] lpfc: nvmet_fc: fix format string
  2017-05-19  8:04 [PATCH] lpfc: nvmet_fc: fix format string Arnd Bergmann
                   ` (2 preceding siblings ...)
  2017-05-29 23:02 ` James Smart
@ 2017-06-01  2:44 ` Martin K. Petersen
  3 siblings, 0 replies; 7+ messages in thread
From: Martin K. Petersen @ 2017-06-01  2:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: James Smart, Dick Kennedy, James E.J. Bottomley,
	Martin K. Petersen, Hannes Reinecke, Johannes Thumshirn,
	linux-scsi, linux-kernel


Arnd,

> The lpfc_nvmeio_data() tracing helper always takes a format string and
> three additional arguments. The latest caller has a format string with
> only two integer arguments, causing this harmless warning:

Applied to 4.12/scsi-fixes. Thank you!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2017-06-01  2:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-19  8:04 [PATCH] lpfc: nvmet_fc: fix format string Arnd Bergmann
2017-05-20 10:28 ` Joe Perches
2017-05-20 19:10   ` Arnd Bergmann
2017-05-21  0:43     ` Joe Perches
2017-05-24  2:36 ` Martin K. Petersen
2017-05-29 23:02 ` James Smart
2017-06-01  2:44 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox