mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] checkpatch --strict | ci-pipeline improvements
@ 2025-10-25 21:15 Jim Cromie
  2025-10-25 21:15 ` [PATCH 1/3] checkpatch: add --drx option and drx_print() helper Jim Cromie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jim Cromie @ 2025-10-25 21:15 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Jim Cromie

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(-)

-- 
2.51.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-10-26 16:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-25 21:15 [PATCH 0/3] checkpatch --strict | ci-pipeline improvements Jim Cromie
2025-10-25 21:15 ` [PATCH 1/3] checkpatch: add --drx option and drx_print() helper Jim Cromie
2025-10-25 23:24   ` Joe Perches
2025-10-25 21:15 ` [PATCH 2/3] checkpatch: recognize __chkp_no_side_effects(_var) hint macro Jim Cromie
2025-10-26 16:48   ` Joe Perches
2025-10-25 21:15 ` [PATCH 3/3] compiler.h: add __chkp_no_side_effects() empty hint/assertion macro Jim Cromie
2025-10-26  0:09   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®