[lkml]   [2017]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 1/1] Coccinelle: array_size: report even if include is missing
Rule r does not depend on rule i (which is the include of
linux/kernel.h) so the output should not depend on i in
org and report mode.

Signed-off-by: Jérémy Lefaure <>

I have tested this patch in report mode on the file
drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_rf.c which does not
use ARRAY_SIZE and does not include linux/kernel.h.

scripts/coccinelle/misc/array_size.cocci | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/coccinelle/misc/array_size.cocci b/scripts/coccinelle/misc/array_size.cocci
index 6ec05710b017..09520f0941f0 100644
--- a/scripts/coccinelle/misc/array_size.cocci
+++ b/scripts/coccinelle/misc/array_size.cocci
@@ -72,13 +72,13 @@ position p;
(sizeof(E)@p /sizeof(T))

-@script:python depends on i&&org@
+@script:python depends on org@
p << r.p;
@@[0], "WARNING should use ARRAY_SIZE")

-@script:python depends on i&&report@
+@script:python depends on report@
p << r.p;

 \ /
  Last update: 2017-09-14 04:54    [W:0.029 / U:6.924 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site