Commit graph

3 commits

Author SHA1 Message Date
Yasushi SHOJI 2b32e47a9a scripts: coccinelle: Fix parse error
The commit coccinelle/coccinelle@47bd4cae52 changed a behavior of
parsing right before coccinelle v1.1.0.  With the commit, the current
scripts under scripts/coccinelle/ errors out with:

   minus: parse error:
     File ".../zephyr/scripts/coccinelle/deref_null.cocci",
     line 25, column 42, charpos = 666
     around = '...',
     whole content =  (E != NULL && ...) ? <+...E->f@p1...+> : ...

I've already raised an issue upstream coccinelle/coccinelle#257.  But
Debian is already shipping v1.1.0 and we need a fix.

The proposed fix doesn't change the semantics, it just explicitly
states that the rule is an expression.

Signed-off-by: Yasushi SHOJI <yashi@spacecubics.com>
2021-04-14 14:18:02 -04:00
Himanshu Jha 817f4b374f coccinelle: Suppress reports/warnings for ext/
The following addition `depends on !(file in "ext")` allows
to exclude `ext/` warnings reported by coccinelle scripts.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-14 19:20:34 -05:00
Himanshu Jha 6aaba6842b coccinelle: Add script to report cases of NULL dereference
This script finds cases of NULL dereferences where a variable
is dereferenced under a NULL test, even though it is known
to be NULL.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-07 10:28:58 -05:00