[PATCH] docs: xforms_lists: allow __maybe_unused in func parameters

Randy Dunlap posted 1 patch 2 months ago
tools/lib/python/kdoc/xforms_lists.py |    1 +
1 file changed, 1 insertion(+)
[PATCH] docs: xforms_lists: allow __maybe_unused in func parameters
Posted by Randy Dunlap 2 months ago
Bart has a patch (not yet merged) that causes kernel-doc warnings:

WARNING: ./include/linux/highmem.h:235 function parameter '__maybe_unused' not described in 'clear_user_pages'
Documentation/mm/highmem:211: ./include/linux/highmem.h:222: WARNING: Error in declarator or parameters

Handle this by adding "__maybe_unused" to the list of known function
parameter modifiers.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202604120025.jtlnpWff-lkp@intel.com/
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bart Van Assche <bvanassche@acm.org>
---
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: linux-doc@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>

 tools/lib/python/kdoc/xforms_lists.py |    1 +
 1 file changed, 1 insertion(+)

--- linext-2026-0410.orig/tools/lib/python/kdoc/xforms_lists.py
+++ linext-2026-0410/tools/lib/python/kdoc/xforms_lists.py
@@ -93,6 +93,7 @@ class CTransforms:
         (CMatch("__weak"), ""),
         (CMatch("__sched"), ""),
         (CMatch("__always_unused"), ""),
+        (CMatch("__maybe_unused"), ""),
         (CMatch("__printf"), ""),
         (CMatch("__(?:re)?alloc_size"), ""),
         (CMatch("__diagnose_as"), ""),
Re: [PATCH] docs: xforms_lists: allow __maybe_unused in func parameters
Posted by Jonathan Corbet 1 month, 2 weeks ago
Randy Dunlap <rdunlap@infradead.org> writes:

> Bart has a patch (not yet merged) that causes kernel-doc warnings:
>
> WARNING: ./include/linux/highmem.h:235 function parameter '__maybe_unused' not described in 'clear_user_pages'
> Documentation/mm/highmem:211: ./include/linux/highmem.h:222: WARNING: Error in declarator or parameters
>
> Handle this by adding "__maybe_unused" to the list of known function
> parameter modifiers.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202604120025.jtlnpWff-lkp@intel.com/
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Bart Van Assche <bvanassche@acm.org>
> ---
> Cc: Jonathan Corbet <corbet@lwn.net>
> Cc: Shuah Khan <skhan@linuxfoundation.org>
> Cc: linux-doc@vger.kernel.org
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
>
>  tools/lib/python/kdoc/xforms_lists.py |    1 +
>  1 file changed, 1 insertion(+)
>
> --- linext-2026-0410.orig/tools/lib/python/kdoc/xforms_lists.py
> +++ linext-2026-0410/tools/lib/python/kdoc/xforms_lists.py
> @@ -93,6 +93,7 @@ class CTransforms:
>          (CMatch("__weak"), ""),
>          (CMatch("__sched"), ""),
>          (CMatch("__always_unused"), ""),
> +        (CMatch("__maybe_unused"), ""),
>          (CMatch("__printf"), ""),

Applied, thanks.

jon
Re: [PATCH] docs: xforms_lists: allow __maybe_unused in func parameters
Posted by Bart Van Assche 2 months ago
On 4/11/26 4:35 PM, Randy Dunlap wrote:
> --- linext-2026-0410.orig/tools/lib/python/kdoc/xforms_lists.py
> +++ linext-2026-0410/tools/lib/python/kdoc/xforms_lists.py
> @@ -93,6 +93,7 @@ class CTransforms:
>           (CMatch("__weak"), ""),
>           (CMatch("__sched"), ""),
>           (CMatch("__always_unused"), ""),
> +        (CMatch("__maybe_unused"), ""),
>           (CMatch("__printf"), ""),
>           (CMatch("__(?:re)?alloc_size"), ""),
>           (CMatch("__diagnose_as"), ""),

Thanks!

Reviewed-by: Bart Van Assche <bvanassche@acm.org>