bpftool: replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE macro
PATCH 1/1 bpftool: replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE macro
From: Rongguang Wei <[email protected]>
Use the ARRAY_SIZE macro and make the code more compact.
Signed-off-by Rongguang Wei <[email protected]>
--- tools/bpf/bpftool/prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/prog.c +1 -1
@@ -1974,7 +1974,7 @@ static int profile_parse_metrics(int argc, char **argv)int selected_cnt =0 ;unsigned int i; - metric_cnt =sizeof (metrics) /sizeof (struct profile_metric ); + metric_cnt =ARRAY_SIZE (metrics);while (argc >0 ) {for (i =0 ; i < metric_cnt; i++) {
Signature · 1 line
2.25.1
Quoted 6 lines · Rongguang Wei
From: Rongguang Wei <[email protected]>
Use the
ARRAY_SIZEmacro and make the code more compact.Signed-off-by Rongguang Wei <[email protected]>
Reviewed-by Quentin Monnet <[email protected]>
Thank you! For future patches, please specify the target tree in the object of the message (“[PATCH bpf-next]” in this case).
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Hello:
This patch was applied to bpf/bpf-next.git (master) by Andrii Nakryiko <[email protected]>:
Quoted 8 lines · On Tue, 26 Jul 2022 17:30:45 +0800 you wrote:
From: Rongguang Wei <[email protected]>
Use the
ARRAY_SIZEmacro and make the code more compact.Signed-off-by Rongguang Wei <[email protected]>--- tools/bpf/bpftool/prog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- bpftool: replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE macro
https://git.kernel.org/bpf/bpf-next/c/5eff8c18f124
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html