Skip to content

Commit 0a4d056

Browse files
Jérémy Lefaurerostedt
authored andcommitted
tracing: Use ARRAY_SIZE() macro instead of open coding it
It is useless to re-invent the ARRAY_SIZE macro so let's use it instead of DATA_CNT. Found with Coccinelle with the following semantic patch: @r depends on (org || report)@ type T; T[] E; position p; @@ ( (sizeof(E)@p /sizeof(*E)) | (sizeof(E)@p /sizeof(E[...])) | (sizeof(E)@p /sizeof(T)) ) Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Jérémy Lefaure <[email protected]> [ Removed useless include of kernel.h ] Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent b0dc52f commit 0a4d056

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/trace/trace_events_filter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2140,7 +2140,7 @@ static struct test_filter_data_t {
21402140
#undef YES
21412141
#undef NO
21422142

2143-
#define DATA_CNT (sizeof(test_filter_data)/sizeof(struct test_filter_data_t))
2143+
#define DATA_CNT ARRAY_SIZE(test_filter_data)
21442144

21452145
static int test_pred_visited;
21462146

0 commit comments

Comments
 (0)