mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
bpftool: Replace sizeof(arr)/sizeof(arr[0]) with ARRAY_SIZE macro
Use the ARRAY_SIZE macro and make the code more compact. Signed-off-by: Rongguang Wei <weirongguang@kylinos.cn> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Reviewed-by: Quentin Monnet <quentin@isovalent.com> Link: https://lore.kernel.org/bpf/20220726093045.3374026-1-clementwei90@163.com
This commit is contained in:
parent
58250ae350
commit
5eff8c18f1
1 changed files with 1 additions and 1 deletions
|
@ -1962,7 +1962,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++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue