mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Geliang Tang <geliang@kernel.org>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>, qmo@kernel.org
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 16:17:38 +0800	[thread overview]
Message-ID: <1c99385c566bc2e58b641060a69d360a21944a65.camel@kernel.org> (raw)
In-Reply-To: <20240724064252.5565-1-zhujun2@cmss.chinamobile.com>

On Tue, 2024-07-23 at 23:42 -0700, Zhu Jun wrote:
> The unsigned int should use "%u" instead of "%d".

I guess you mean:

The format specifier of "unsigned int" in printf() should be "%u", not
"%d".

> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>

Acked-by: Geliang Tang <geliang@kernel.org>

> ---
>  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);
>  		print_bpf_insn(&cbs, insn + i, true);
>  
>  		if (opcodes) {
> @@ -415,7 +415,7 @@ void dump_xlated_for_graph(struct dump_data *dd,
> void *buf_start, void *buf_end,
>  			}
>  		}
>  
> -		printf("%d: ", insn_off);
> +		printf("%u: ", insn_off);
>  		print_bpf_insn(&cbs, cur, true);
>  
>  		if (opcodes) {


  reply	other threads:[~2024-07-24  8:17 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 [this message]
2024-07-24  8:48 ` Quentin Monnet

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=1c99385c566bc2e58b641060a69d360a21944a65.camel@kernel.org \
    --to=geliang@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=qmo@kernel.org \
    --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®