Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf tests: Use ARRAY_SIZE() were applicable

We were using a homebrew equivalent, use the macro that is used
everywhere for this function.

Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-bp3wokafua1ecairau77jcy0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+2 -7
+2 -7
tools/perf/tests/pmu.c
··· 19 19 { "krava23", "config2:28-29,38\n", }, 20 20 }; 21 21 22 - #define TEST_FORMATS_CNT (sizeof(test_formats) / sizeof(struct test_format)) 23 - 24 22 /* Simulated users input. */ 25 23 static struct parse_events_term test_terms[] = { 26 24 { ··· 76 78 .type_term = PARSE_EVENTS__TERM_TYPE_USER, 77 79 }, 78 80 }; 79 - #define TERMS_CNT (sizeof(test_terms) / sizeof(struct parse_events_term)) 80 81 81 82 /* 82 83 * Prepare format directory data, exported by kernel ··· 90 93 if (!mkdtemp(dir)) 91 94 return NULL; 92 95 93 - for (i = 0; i < TEST_FORMATS_CNT; i++) { 96 + for (i = 0; i < ARRAY_SIZE(test_formats); i++) { 94 97 static char name[PATH_MAX]; 95 98 struct test_format *format = &test_formats[i]; 96 99 FILE *file; ··· 127 130 static LIST_HEAD(terms); 128 131 unsigned int i; 129 132 130 - for (i = 0; i < TERMS_CNT; i++) 133 + for (i = 0; i < ARRAY_SIZE(test_terms); i++) 131 134 list_add_tail(&test_terms[i].list, &terms); 132 135 133 136 return &terms; 134 137 } 135 - 136 - #undef TERMS_CNT 137 138 138 139 int test__pmu(void) 139 140 {