diff --git a/coccinelle/const-strlen.cocci b/coccinelle/const-strlen.cocci index 38bf9b118fd..30a6e5a88ed 100644 --- a/coccinelle/const-strlen.cocci +++ b/coccinelle/const-strlen.cocci @@ -1,8 +1,12 @@ @@ constant s; @@ +( +#define STRLEN +& - sizeof(s)-1 + STRLEN(s) +) @@ constant s; @@ diff --git a/coccinelle/debug-logging.cocci b/coccinelle/debug-logging.cocci index 9084cf773bf..a679dab0115 100644 --- a/coccinelle/debug-logging.cocci +++ b/coccinelle/debug-logging.cocci @@ -1,8 +1,16 @@ @@ @@ +( +#define DEBUG_LOGGING +& - _unlikely_(log_get_max_level() >= LOG_DEBUG) + DEBUG_LOGGING +) @@ @@ +( +#define DEBUG_LOGGING +& - log_get_max_level() >= LOG_DEBUG + DEBUG_LOGGING +) diff --git a/coccinelle/memzero.cocci b/coccinelle/memzero.cocci index ebdc3f6a2a9..8198cc84b4c 100644 --- a/coccinelle/memzero.cocci +++ b/coccinelle/memzero.cocci @@ -21,10 +21,18 @@ expression s; @@ expression a, b; @@ +( +#define memzero +& - memset(a, 0, b) + memzero(a, b) +) @@ expression a, b; @@ +( +#define memzero +& - bzero(a, b) + memzero(a, b) +)