mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>
Cc: ast@kernel.org, daniel@iogearbox.net, martin.lau@linux.dev,
	eddyz87@gmail.com, song@kernel.org, yonghong.song@linux.dev,
	john.fastabend@gmail.com, kpsingh@kernel.org, sdf@fomichev.me,
	haoluo@google.com, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/bpf:Fix the wrong format specifier
Date: Wed, 24 Jul 2024 09:48:55 +0100	[thread overview]
Message-ID: <a3c16c68-f6ff-47fd-b074-f42b2dad3b57@kernel.org> (raw)
In-Reply-To: <20240724064252.5565-1-zhujun2@cmss.chinamobile.com>

2024-07-23 23:42 UTC-0700 ~ Zhu Jun <zhujun2@cmss.chinamobile.com>
> The unsigned int should use "%u" instead of "%d".
> 
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
>  tools/bpf/bpftool/xlated_dumper.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/bpf/bpftool/xlated_dumper.c b/tools/bpf/bpftool/xlated_dumper.c
> index 567f56dfd9f1..3efa639434be 100644
> --- a/tools/bpf/bpftool/xlated_dumper.c
> +++ b/tools/bpf/bpftool/xlated_dumper.c
> @@ -349,7 +349,7 @@ void dump_xlated_plain(struct dump_data *dd, void *buf, unsigned int len,
>  
>  		double_insn = insn[i].code == (BPF_LD | BPF_IMM | BPF_DW);
>  
> -		printf("% 4d: ", i);
> +		printf("% 4u: ", i);


Thanks! But did you try to compile this? It produces a warning:

	xlated_dumper.c: In function ‘dump_xlated_plain’:
	xlated_dumper.c:352:28: warning: ' ' flag used with ‘%u’ gnu_printf format [-Wformat=]
	  352 |                 printf("% 4u: ", i);
	      |                            ^

Please fix it.

Quentin

      parent reply	other threads:[~2024-07-24  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24  6:42 Zhu Jun
2024-07-24  8:17 ` Geliang Tang
2024-07-24  8:48 ` Quentin Monnet [this message]

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=a3c16c68-f6ff-47fd-b074-f42b2dad3b57@kernel.org \
    --to=qmo@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=eddyz87@gmail.com \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    --cc=zhujun2@cmss.chinamobile.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®