BPF List
 help / color / mirror / Atom feed
From: Quentin Monnet <qmo@kernel.org>
To: liujing <liujing@cmss.chinamobile.com>
Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org,
	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,
	jolsa@kernel.org, bpf@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bpftool: Fix the wrong format specifier
Date: Thu, 21 Nov 2024 11:46:42 +0000	[thread overview]
Message-ID: <2bb08736-bcbd-4d74-a878-2598301e0182@kernel.org> (raw)
In-Reply-To: <20241121085518.3738-1-liujing@cmss.chinamobile.com>

2024-11-21 16:55 UTC+0800 ~ liujing <liujing@cmss.chinamobile.com>
> The type of lines is unsigned int, so the correct format specifier should be
> %u instead of %d.
> 
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
> 
> diff --git a/tools/bpf/bpftool/main.c b/tools/bpf/bpftool/main.c
> index 08d0ac543c67..030556ce4d61 100644
> --- a/tools/bpf/bpftool/main.c
> +++ b/tools/bpf/bpftool/main.c
> @@ -423,7 +423,7 @@ static int do_batch(int argc, char **argv)
>  		err = -1;
>  	} else {
>  		if (!json_output)
> -			printf("processed %d commands\n", lines);
> +			printf("processed %u commands\n", lines);
>  	}
>  err_close:
>  	if (fp != stdin)


Thank you for the fix. While at it can you also fix the format specifier
for the other two prints of "lines" in the function (via "p_err()"),
please? I guess they're not raised by your static checker, but they
should be addressed just the same.

Quentin

  reply	other threads:[~2024-11-21 11:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21  8:55 [PATCH] bpftool: Fix the wrong format specifier liujing
2024-11-21 11:46 ` Quentin Monnet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-11-21 12:17 liujing
2024-11-21 12:43 ` Alexis Lothoré
2024-11-21 15:35   ` Quentin Monnet
2024-11-25 22:32 ` Alexei Starovoitov

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=2bb08736-bcbd-4d74-a878-2598301e0182@kernel.org \
    --to=qmo@kernel.org \
    --cc=andrii@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=jolsa@kernel.org \
    --cc=kpsingh@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liujing@cmss.chinamobile.com \
    --cc=martin.lau@linux.dev \
    --cc=sdf@fomichev.me \
    --cc=song@kernel.org \
    --cc=yonghong.song@linux.dev \
    /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