Skip to content

checkpatch --strict | ci-pipeline improvements

Jim Cromie linux-sparse lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3checkpatch: add --drx option and drx_print() helperscripts/checkpatch.pl+26 -01 reply
2/3checkpatch: recognize __chkp_no_side_effects(_var) hint macroscripts/checkpatch.pl+17 -41 reply
3/3compiler.h: add __chkp_no_side_effects() empty hint/assertion macroinclude/linux/compiler.h+12 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] checkpatch --strict | ci-pipeline improvements

Several CI-pipelines call to checkpatch.pl --strict, so CHECK reports there can disrupt pipeline flow. This patchset addresses one such check.

CHECK: Macro argument reuse '_var' - possible side-effects?

Multi-statement declarative macros (both top-of-scope and file-scope), commonly fall victim to this warning, checkpatch even has a list of named exceptions to silence some of the checks.

This patchset provides a more focussed approach:

1 #define __chkp_no_side_effects(...) /* nothing */
so no functional change due to its use.

2 teach checkpatch how to silence THAT WARNING on that _var
find the macro call in macro-body, extract no-side-effect-vars process the macro body as usual, count arg expansions before issuing CHECK, check the no-side-effect-vars

3 authors add the assertion to their noisy macros
active assertion of safety, per variable, not full pardon by name indicates they tested against --strict

Jim Cromie (3):
checkpatch: add --drx option and drx_print() helper
checkpatch: recognize __chkp_no_side_effects(_var) hint macro compiler.h: add __chkp_no_side_effects() empty hint/assertion macro

 include/linux/compiler.h | 12 ++++++++++
 scripts/checkpatch.pl    | 47 ++++++++++++++++++++++++++++++++++++----
 2 files changed, 55 insertions(+), 4 deletions(-)
Signature · 1 line
2.51.0