Skip to contentSkip to conversation

lpfc: nvmet_fc: fix format string

PATCH Applied Arnd Bergmann 4 participants 7 messages May 19, 2017 – Jun 1, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lpfc: nvmet_fc: fix format string

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")
---
 drivers/scsi/lpfc/lpfc_nvmet.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/lpfc/lpfc_nvmet.c +2 -2
index f94294b77b7b..24d54dd016d4 100644
@@ -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);
 
Signature · 1 line
2.9.0
#1 lore raw
Quoted 2 lines · Arnd Bergmann

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.

Quoted 9 lines

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.

#2 lore raw
Quoted 8 lines · Joe Perches
Quoted 2 lines · Arnd Bergmann

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

#3 lore raw
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · Joe Perches
Quoted 2 lines · Arnd Bergmann

The lpfc_nvmeio_data() tracing helper always takes a format string and three additional arguments.

Quoted 8 lines
Quoted 4 lines

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.

#4 lore raw
In reply to Arnd Bergmann

Arnd,

Quoted 3 lines

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?

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#5 lore raw
In reply to Arnd Bergmann

Patch is fine.

-- james

Quoted 15 lines · Arnd Bergmann

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

---

#6 lore raw
In reply to Arnd Bergmann

Arnd,

Quoted 3 lines

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!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering