Subject: Re: [PATCH] rdma: Fix res_print_uint()

From: Leon Romanovsky <[email-masked]>
Date: Thu, 3 Mar 2022 20:44:00 +0200

On Wed, Mar 02, 2022 at 11:06:41AM +0800, Shangyan Zhou wrote:
> Print unsigned int should use "%u" instead of "%d"
> 
> Signed-off-by: Shangyan Zhou <[email-masked]>
> ---
>  rdma/res.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rdma/res.c b/rdma/res.c
> index 21fef9bd..832b795d 100644
> --- a/rdma/res.c
> +++ b/rdma/res.c
> @@ -214,7 +214,7 @@ void res_print_uint(struct rd *rd, const char *name, uint64_t val,
>  	if (!nlattr)
>  		return;
>  	print_color_uint(PRINT_ANY, COLOR_NONE, name, name, val);
> -	print_color_uint(PRINT_FP, COLOR_NONE, NULL, " %d ", val);
> +	print_color_uint(PRINT_FP, COLOR_NONE, NULL, " %u ", val);

val is uint64_t, so the more correct change will need to use print_u64(...)
and "%"PRIu64 instead of %u/%d, but I don't know if _color_ variant exists
for *_u64.

Thanks

>  }
>  
>  RES_FUNC(res_no_args,	RDMA_NLDEV_CMD_RES_GET,	NULL, true, 0);
> -- 
> 2.20.1
>