All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Shangyan Zhou <sy.zhou@hotmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] rdma: Fix res_print_uint()
Date: Thu, 3 Mar 2022 20:44:00 +0200	[thread overview]
Message-ID: <YiEMcDbZAvSsFURj@unreal> (raw)
In-Reply-To: <TYCPR01MB7578E54F06AEFE50785B771CE3039@TYCPR01MB7578.jpnprd01.prod.outlook.com>

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 <sy.zhou@hotmail.com>
> ---
>  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
> 

  reply	other threads:[~2022-03-03 18:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02  3:06 [PATCH] rdma: Fix res_print_uint() Shangyan Zhou
2022-03-03 18:44 ` Leon Romanovsky [this message]
2022-03-04  3:17   ` Shangyan Zhou
2022-03-04  3:00 ` [PATCH v2] " Shangyan Zhou
2022-03-04  7:02   ` Leon Romanovsky
2022-03-04 12:47     ` Shangyan Zhou
2022-03-04 12:46   ` [PATCH v3] rdma: Fix res_print_uint() and add res_print_u64() Shangyan Zhou
2022-03-04 17:33     ` Leon Romanovsky
2022-03-06  7:00       ` Shangyan Zhou
2022-03-06  6:56     ` [PATCH v4] rdma: Fix the logic to print unsigned int Shangyan Zhou
2022-03-07 12:49       ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YiEMcDbZAvSsFURj@unreal \
    --to=leon@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sy.zhou@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.