summaryrefslogtreecommitdiffstats
path: root/tools/coccinelle/hash_compare_null_values_check.cocci
blob: 38649a228273f6c70cc0b28649bbd139727647a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// There is no need to test for null values in the hash compare
// function as that we are guaranteed to send in data in
// the hash compare functions.
@@
identifier fn =~ "_hash_cmp";
type T;
identifier p1;
identifier p2;
@@

?static
T fn(...)
{
...
- if (p1 == NULL && p2 == NULL)
-	return ...;
- if (p1 == NULL || p2 == NULL)
-	return ...;
...
}