[PATCH] nvmet: fix a format specifier in nvmet_auth_ctrl_exponential

Justin Stitt justinstitt at google.com
Mon Aug 1 11:19:39 PDT 2022


On Mon, Jul 18, 2022 at 07:03:56AM +0200, Christoph Hellwig wrote:
> dh_keysize is a size_t, use the proper format specifier for printing it.
> 
> Reported-by: Guenter Roeck <linux at roeck-us.net>
> Signed-off-by: Christoph Hellwig <hch at lst.de>
> ---
>  drivers/nvme/target/auth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/target/auth.c b/drivers/nvme/target/auth.c
> index b41c7bbcc4366..cf690df347758 100644
> --- a/drivers/nvme/target/auth.c
> +++ b/drivers/nvme/target/auth.c
> @@ -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 {
> -- 
> 2.30.2
> 
> 
> 
This patch runs parallel to our efforts to re-enable -Wformat.
See here: https://lore.kernel.org/all/20220720232332.2720091-1-justinstitt@google.com/

Hopefully this patch gets picked up by a maintainer so that Masahiro can
stage a clean PR re-enabling the -Wformat warning.

Reviewed-by: Justin Stitt <justinstitt at google.com>



More information about the Linux-nvme mailing list