All of lore.kernel.org
 help / color / mirror / Atom feed
* + checkpatch-add-context-analysis-attributes.patch added to mm-nonmm-unstable branch
@ 2026-11-13  1:51 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-11-13  1:51 UTC (permalink / raw)
  To: mm-commits, joe, elver, dwaipayanray1, apw, vdonnefort, akpm


The patch titled
     Subject: checkpatch: add context-analysis attributes
has been added to the -mm mm-nonmm-unstable branch.  Its filename is
     checkpatch-add-context-analysis-attributes.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/checkpatch-add-context-analysis-attributes.patch

This patch will later appear in the mm-nonmm-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Vincent Donnefort <vdonnefort@google.com>
Subject: checkpatch: add context-analysis attributes
Date: Thu, 12 Nov 2026 15:12:03 +0000

Checkpatch doesn't know about the context analysis attributes and
misparses annotated declarations (e.g.  mistaking __guarded_by() fields
for extern prototype).  Add them to the known attributes list.

Link: https://lore.kernel.org/20261112151203.3129005-1-vdonnefort@google.com
Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Marco Elver <elver@google.com>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>
---

 scripts/checkpatch.pl |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

--- a/scripts/checkpatch.pl~checkpatch-add-context-analysis-attributes
+++ a/scripts/checkpatch.pl
@@ -526,6 +526,25 @@ our $InitAttributeData = qr{$InitAttribu
 our $InitAttributeConst = qr{$InitAttributePrefix(?:initconst\b)};
 our $InitAttributeInit = qr{$InitAttributePrefix(?:init\b)};
 our $InitAttribute = qr{$InitAttributeData|$InitAttributeConst|$InitAttributeInit};
+our $ContextAnalysis = qr{
+			__guarded_by\b|
+			__pt_guarded_by\b|
+			__rcu_guarded\b|
+			__must_hold\b|
+			__must_hold_shared\b|
+			__must_not_hold\b|
+			__acquires\b|
+			__acquires_shared\b|
+			__cond_acquires\b|
+			__cond_acquires_shared\b|
+			__releases\b|
+			__releases_shared\b|
+			__cond_releases\b|
+			__no_context_analysis\b|
+			__context_unsafe\b|
+			__acquires_ret\b|
+			__acquires_shared_ret\b
+		}x;
 
 # Notes to $Attribute:
 # We need \b after 'init' otherwise 'initconst' will cause a false positive in a check
@@ -551,6 +570,7 @@ our $Attribute	= qr{
 			__ro_after_init|
 			__kprobes|
 			$InitAttribute|
+			$ContextAnalysis|
 			__aligned\s*\(.*\)|
 			____cacheline_aligned|
 			____cacheline_aligned_in_smp|
_

Patches currently in -mm which might be from vdonnefort@google.com are

checkpatch-add-context-analysis-attributes.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13  1:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-13  1:51 + checkpatch-add-context-analysis-attributes.patch added to mm-nonmm-unstable branch Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.