lkml.org 
[lkml]   [2018]   [Dec]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] scripts: coccinelle: boolinit: drop warnings on named constants
Date
Coccinelle doesn't always have access to the values of named
(#define) constants, and they may likely often be bound to true
and false values anyway, resulting in false positives. So stop
warning about them.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
scripts/coccinelle/misc/boolinit.cocci | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/scripts/coccinelle/misc/boolinit.cocci b/scripts/coccinelle/misc/boolinit.cocci
index b0584a3..aabb581 100644
--- a/scripts/coccinelle/misc/boolinit.cocci
+++ b/scripts/coccinelle/misc/boolinit.cocci
@@ -136,9 +136,14 @@ position p1;
@r4 depends on !patch@
bool b;
position p2;
+identifier i;
constant c != {0,1};
@@
+(
+ b = i
+|
*b@p2 = c
+)

@script:python depends on org@
p << r1.p;
\
 
 \ /
  Last update: 2018-12-29 07:52    [W:0.041 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site