mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] bpftool: Fix wrong format output
@ 2024-11-21  8:47 liujing
  2024-11-21 11:41 ` Quentin Monnet
  2024-11-21 11:42 ` Quentin Monnet
  0 siblings, 2 replies; 4+ messages in thread
From: liujing @ 2024-11-21  8:47 UTC (permalink / raw)
  To: qmo
  Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf, linux-kernel,
	liujing, liujing

From: liujing <liujing_yewu@cmss.chinamobile.com>

%d in format string requires 'int' but the argument type
of pf is 'unsigned int'.

Signed-off-by: liujing <liujing@cmss.chinamobile.com>

diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
index 5cd503b763d7..5bc442d93456 100644
--- a/tools/bpf/bpftool/link.c
+++ b/tools/bpf/bpftool/link.c
@@ -699,7 +699,7 @@ void netfilter_dump_plain(const struct bpf_link_info *info)
 	if (pfname)
 		printf("\n\t%s", pfname);
 	else
-		printf("\n\tpf: %d", pf);
+		printf("\n\tpf: %u", pf);
 
 	if (hookname)
 		printf(" %s", hookname);
-- 
2.27.0




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bpftool: Fix wrong format output
  2024-11-21  8:47 [PATCH] bpftool: Fix wrong format output liujing
@ 2024-11-21 11:41 ` Quentin Monnet
  2024-11-21 11:42 ` Quentin Monnet
  1 sibling, 0 replies; 4+ messages in thread
From: Quentin Monnet @ 2024-11-21 11:41 UTC (permalink / raw)
  To: liujing
  Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf, linux-kernel,
	liujing

2024-11-21 16:47 UTC+0800 ~ liujing <liujing@cmss.chinamobile.com>
> From: liujing <liujing_yewu@cmss.chinamobile.com>
> 
> %d in format string requires 'int' but the argument type
> of pf is 'unsigned int'.
> 
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>

Reviewed-by: Quentin Monnet <qmo@kernel.org>

Thank you

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bpftool: Fix wrong format output
  2024-11-21  8:47 [PATCH] bpftool: Fix wrong format output liujing
  2024-11-21 11:41 ` Quentin Monnet
@ 2024-11-21 11:42 ` Quentin Monnet
  2024-11-21 11:45   ` Quentin Monnet
  1 sibling, 1 reply; 4+ messages in thread
From: Quentin Monnet @ 2024-11-21 11:42 UTC (permalink / raw)
  To: liujing
  Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf, linux-kernel,
	liujing

2024-11-21 16:47 UTC+0800 ~ liujing <liujing@cmss.chinamobile.com>
> From: liujing <liujing_yewu@cmss.chinamobile.com>
> 
> %d in format string requires 'int' but the argument type
> of pf is 'unsigned int'.
> 
> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
> 
> diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
> index 5cd503b763d7..5bc442d93456 100644
> --- a/tools/bpf/bpftool/link.c
> +++ b/tools/bpf/bpftool/link.c
> @@ -699,7 +699,7 @@ void netfilter_dump_plain(const struct bpf_link_info *info)
>  	if (pfname)
>  		printf("\n\t%s", pfname);
>  	else
> -		printf("\n\tpf: %d", pf);
> +		printf("\n\tpf: %u", pf);
>  
>  	if (hookname)
>  		printf(" %s", hookname);


Thanks, but while at it can you also fix the format specifier for the
other two prints of "lines" in the function (via "p_err()"), please?

Quentin

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] bpftool: Fix wrong format output
  2024-11-21 11:42 ` Quentin Monnet
@ 2024-11-21 11:45   ` Quentin Monnet
  0 siblings, 0 replies; 4+ messages in thread
From: Quentin Monnet @ 2024-11-21 11:45 UTC (permalink / raw)
  To: liujing
  Cc: ast, daniel, andrii, martin.lau, eddyz87, song, yonghong.song,
	john.fastabend, kpsingh, sdf, haoluo, jolsa, bpf, linux-kernel,
	liujing

2024-11-21 11:42 UTC+0000 ~ Quentin Monnet <qmo@kernel.org>
> 2024-11-21 16:47 UTC+0800 ~ liujing <liujing@cmss.chinamobile.com>
>> From: liujing <liujing_yewu@cmss.chinamobile.com>
>>
>> %d in format string requires 'int' but the argument type
>> of pf is 'unsigned int'.
>>
>> Signed-off-by: liujing <liujing@cmss.chinamobile.com>
>>
>> diff --git a/tools/bpf/bpftool/link.c b/tools/bpf/bpftool/link.c
>> index 5cd503b763d7..5bc442d93456 100644
>> --- a/tools/bpf/bpftool/link.c
>> +++ b/tools/bpf/bpftool/link.c
>> @@ -699,7 +699,7 @@ void netfilter_dump_plain(const struct bpf_link_info *info)
>>  	if (pfname)
>>  		printf("\n\t%s", pfname);
>>  	else
>> -		printf("\n\tpf: %d", pf);
>> +		printf("\n\tpf: %u", pf);
>>  
>>  	if (hookname)
>>  		printf(" %s", hookname);
> 
> 
> Thanks, but while at it can you also fix the format specifier for the
> other two prints of "lines" in the function (via "p_err()"), please?

Apologies, I got confused between your two patches when replying. Please
disregard the above for this patch, it looks good as it is.

Quentin

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-21 11:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-21  8:47 [PATCH] bpftool: Fix wrong format output liujing
2024-11-21 11:41 ` Quentin Monnet
2024-11-21 11:42 ` Quentin Monnet
2024-11-21 11:45   ` Quentin Monnet

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®