1
0
Fork 0
frr/tools/coccinelle/hash_compare_null_values_check.cocci
Daniel Baumann 3124f89aed
Adding upstream version 10.1.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2025-02-05 10:03:58 +01:00

20 lines
349 B
Text

// 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 ...;
...
}