[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260123074049.3912065-1-rdunlap@infradead.org>
Date: Thu, 22 Jan 2026 23:40:49 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: linux-kernel@...r.kernel.org
Cc: Randy Dunlap <rdunlap@...radead.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Jonathan Corbet <corbet@....net>,
Shuah Khan <skhan@...uxfoundation.org>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-doc@...r.kernel.org,
Peter Zijlstra <peterz@...radead.org>,
Marco Elver <elver@...gle.com>
Subject: [PATCH] docs: kdoc_parser: ignore __cond_acquires()
Drop "__cond_acquires(.*)" in function prototypes to avoid kernel-doc
warnings.
Documentation/core-api/kref:328: ../include/linux/kref.h:72: WARNING: Invalid C declaration: Expected end of definition. [error at 96]
int kref_put_mutex (struct kref *kref, void (*release)(struct kref *kref), struct mutex *mutex) __cond_acquires(true# mutex)
------------------------------------------------------------------------------------------------^
Documentation/core-api/kref:328: ../include/linux/kref.h:94: WARNING: Invalid C declaration: Expected end of definition. [error at 92]
int kref_put_lock (struct kref *kref, void (*release)(struct kref *kref), spinlock_t *lock) __cond_acquires(true# lock)
--------------------------------------------------------------------------------------------^
Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
Closes: https://lore.kernel.org/all/20260107161548.45530e1c@canb.auug.org.au/
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
The regex is suggested by Mauro; mine was too greedy. Thanks.
Cc: Jonathan Corbet <corbet@....net>
Cc: Shuah Khan <skhan@...uxfoundation.org>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>
Cc: linux-doc@...r.kernel.org
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Marco Elver <elver@...gle.com>
tools/lib/python/kdoc/kdoc_parser.py | 1 +
1 file changed, 1 insertion(+)
--- linux-next-20260121.orig/tools/lib/python/kdoc/kdoc_parser.py
+++ linux-next-20260121/tools/lib/python/kdoc/kdoc_parser.py
@@ -186,6 +186,7 @@ function_xforms = [
(KernRe(r"__sched +"), ""),
(KernRe(r"_noprof"), ""),
(KernRe(r"__always_unused *"), ""),
+ (KernRe(r"__cond_acquires\s*\([^\)]*\)"), ""),
(KernRe(r"__printf\s*\(\s*\d*\s*,\s*\d*\s*\) +"), ""),
(KernRe(r"__(?:re)?alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) +"), ""),
(KernRe(r"__diagnose_as\s*\(\s*\S+\s*(?:,\s*\d+\s*)*\) +"), ""),
Powered by blists - more mailing lists