diff options
author | Jérémy Lefaure <jeremy.lefaure@lse.epita.fr> | 2017-10-15 21:22:49 -0400 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2018-04-11 11:30:33 -0400 |
commit | 0a4d0564f0fc377ad0ba66ce214b9b16324aea4b (patch) | |
tree | 31dc7eec2d77568c347f82ef4024434a0126f1cb /kernel | |
parent | b0dc52f15e7fe2b973ecfe4f3706f1b35ce3943a (diff) | |
download | linux-0a4d0564f0fc377ad0ba66ce214b9b16324aea4b.tar.gz linux-0a4d0564f0fc377ad0ba66ce214b9b16324aea4b.tar.bz2 linux-0a4d0564f0fc377ad0ba66ce214b9b16324aea4b.zip |
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/20171016012250.26453-1-jeremy.lefaure@lse.epita.fr
Signed-off-by: Jérémy Lefaure <jeremy.lefaure@lse.epita.fr>
[ Removed useless include of kernel.h ]
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/trace_events_filter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 1bda4ec95e18..5eba1cec945c 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c @@ -2140,7 +2140,7 @@ static struct test_filter_data_t { #undef YES #undef NO -#define DATA_CNT (sizeof(test_filter_data)/sizeof(struct test_filter_data_t)) +#define DATA_CNT ARRAY_SIZE(test_filter_data) static int test_pred_visited; |