[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2bb08736-bcbd-4d74-a878-2598301e0182@kernel.org>
Date: Thu, 21 Nov 2024 11:46:42 +0000
From: Quentin Monnet <qmo@...nel.org>
To: liujing <liujing@...s.chinamobile.com>
Cc: ast@...nel.org, daniel@...earbox.net, andrii@...nel.org,
martin.lau@...ux.dev, eddyz87@...il.com, song@...nel.org,
yonghong.song@...ux.dev, john.fastabend@...il.com, kpsingh@...nel.org,
sdf@...ichev.me, haoluo@...gle.com, jolsa@...nel.org, bpf@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] bpftool: Fix the wrong format specifier
2024-11-21 16:55 UTC+0800 ~ liujing <liujing@...s.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@...s.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
Powered by blists - more mailing lists