Skip to contentSkip to conversation

drivers/nvme: fix pr_warn format string

PATCH In review Max Filippov 2 participants 2 messages Jul 25, 2022 – Jul 26, 2022

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

PATCH 1/1 drivers/nvme: fix pr_warn format string

Use %zu format instead of %lu to print variable of size_t type. This fixes the following gcc build error on 32-bit targets:

error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'size_t' {aka 'unsigned int'}

Fixes 71ebe3842ebe ("nvmet-auth: Diffie-Hellman key exchange support")
---
 drivers/nvme/target/auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/auth.c +1 -1
index bf92435c783c..716a10ca91d1 100644
@@ -488,7 +488,7 @@ int nvmet_auth_ctrl_exponential(struct nvmet_req *req,
 		return -ENOKEY;
 	}
 	if (buf_size != ctrl->dh_keysize) {
-		pr_warn("ctrl %d DH public key size mismatch, need %lu is %d\n",
+		pr_warn("ctrl %d DH public key size mismatch, need %zu is %d\n",
 			ctrl->cntlid, ctrl->dh_keysize, buf_size);
 		ret = -EINVAL;
 	} else {
Signature · 1 line
2.30.2
#1 lore raw

This was already fixed by:

commit d6f7cd209b089553ce0217eb0091f5f5fdc654ba

Author: Christoph Hellwig <[email protected]>
Date:   Mon Jul 18 07:02:29 2022 +0200

nvmet: fix a format specifier in nvmet_auth_ctrl_exponential