summaryrefslogtreecommitdiff
path: root/coccinelle/debug-logging.cocci
Commit message (Collapse)AuthorAgeFilesLines
* licensing: add spdx to our .cocci filesZbigniew Jędrzejewski-Szmek2021-10-011-0/+1
| | | | | Since those are chunks of code based on our codebase, it's easiest to use the same license.
* coccinelle: ignore macro transformations in the macros themselvesFrantisek Sumsal2019-04-281-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | For example, the following transformation: - sizeof(s)-1 + STRLEN(s) would replace sizeof by STRLEN even in the STRLEN macro definition itself, which generates following nonsensical patch: --- src/basic/macro.h +++ /tmp/cocci-output-8753-b50773-macro.h @@ -182,7 +182,7 @@ static inline unsigned long ALIGN_POWER2 * Contrary to strlen(), this is a constant expression. * @x: a string literal. */ -#define STRLEN(x) (sizeof(""x"") - 1) +#define STRLEN(x) (STRLEN("" x "")) /* * container_of - cast a member of a structure out to the containing structure Let's exclude the macro itself from the transformation to avoid this
* tree-wide: add DEBUG_LOGGING macro that checks whether debug logging is on ↵Lennart Poettering2017-12-151-0/+8
(#7645) This makes things a bit easier to read I think, and also makes sure we always use the _unlikely_ wrapper around it, which so far we used sometimes and other times we didn't. Let's clean that up.