docs: xforms_lists: ignore context analysis and lock attributes

Drop context analysis and lock (tracking) attributes to avoid
kernel-doc warnings.

There are now lots of warnings like these:

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

The regex is suggested by Mauro; mine was too greedy. Thanks.
Updated context analysis and lock macros list provided by PeterZ. Thanks.

[mchehab: modified to be applied after xforms_lists split]

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/all/20260107161548.45530e1c@canb.auug.org.au/
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <3c7fdfc364a8920f92530b47bdbf4bb29a40371f.1772469446.git.mchehab+huawei@kernel.org>
This commit is contained in:
Randy Dunlap
2026-03-02 17:40:56 +01:00
committed by Jonathan Corbet
parent d842057c4a
commit 4ff59bdd93
2 changed files with 15 additions and 0 deletions

View File

@@ -75,6 +75,16 @@ doc_begin_func = KernRe(str(doc_com) + # initial " * '
# is allowed.
#
struct_nested_prefixes = [
(re.compile(r"__cond_acquires\s*\("), ""),
(re.compile(r"__cond_releases\s*\("), ""),
(re.compile(r"__acquires\s*\("), ""),
(re.compile(r"__releases\s*\("), ""),
(re.compile(r"__must_hold\s*\("), ""),
(re.compile(r"__must_not_hold\s*\("), ""),
(re.compile(r"__must_hold_shared\s*\("), ""),
(re.compile(r"__cond_acquires_shared\s*\("), ""),
(re.compile(r"__acquires_shared\s*\("), ""),
(re.compile(r"__releases_shared\s*\("), ""),
(re.compile(r'\bSTRUCT_GROUP\('), r'\1'),
]