diff options
-rw-r--r-- | tools/perf/tests/pmu.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/tools/perf/tests/pmu.c b/tools/perf/tests/pmu.c index 6803ed1a06dd..12b322fa3475 100644 --- a/tools/perf/tests/pmu.c +++ b/tools/perf/tests/pmu.c | |||
@@ -19,8 +19,6 @@ static struct test_format { | |||
19 | { "krava23", "config2:28-29,38\n", }, | 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 | /* Simulated users input. */ | 22 | /* Simulated users input. */ |
25 | static struct parse_events_term test_terms[] = { | 23 | static struct parse_events_term test_terms[] = { |
26 | { | 24 | { |
@@ -78,7 +76,6 @@ static struct parse_events_term test_terms[] = { | |||
78 | .type_term = PARSE_EVENTS__TERM_TYPE_USER, | 76 | .type_term = PARSE_EVENTS__TERM_TYPE_USER, |
79 | }, | 77 | }, |
80 | }; | 78 | }; |
81 | #define TERMS_CNT (sizeof(test_terms) / sizeof(struct parse_events_term)) | ||
82 | 79 | ||
83 | /* | 80 | /* |
84 | * Prepare format directory data, exported by kernel | 81 | * Prepare format directory data, exported by kernel |
@@ -93,7 +90,7 @@ static char *test_format_dir_get(void) | |||
93 | if (!mkdtemp(dir)) | 90 | if (!mkdtemp(dir)) |
94 | return NULL; | 91 | return NULL; |
95 | 92 | ||
96 | for (i = 0; i < TEST_FORMATS_CNT; i++) { | 93 | for (i = 0; i < ARRAY_SIZE(test_formats); i++) { |
97 | static char name[PATH_MAX]; | 94 | static char name[PATH_MAX]; |
98 | struct test_format *format = &test_formats[i]; | 95 | struct test_format *format = &test_formats[i]; |
99 | FILE *file; | 96 | FILE *file; |
@@ -130,14 +127,12 @@ static struct list_head *test_terms_list(void) | |||
130 | static LIST_HEAD(terms); | 127 | static LIST_HEAD(terms); |
131 | unsigned int i; | 128 | unsigned int i; |
132 | 129 | ||
133 | for (i = 0; i < TERMS_CNT; i++) | 130 | for (i = 0; i < ARRAY_SIZE(test_terms); i++) |
134 | list_add_tail(&test_terms[i].list, &terms); | 131 | list_add_tail(&test_terms[i].list, &terms); |
135 | 132 | ||
136 | return &terms; | 133 | return &terms; |
137 | } | 134 | } |
138 | 135 | ||
139 | #undef TERMS_CNT | ||
140 | |||
141 | int test__pmu(void) | 136 | int test__pmu(void) |
142 | { | 137 | { |
143 | char *format = test_format_dir_get(); | 138 | char *format = test_format_dir_get(); |