[PATCH 7/7] docs: kdoc: remove redundant comment stripping

Jonathan Corbet posted 7 patches 1 month, 3 weeks ago
[PATCH 7/7] docs: kdoc: remove redundant comment stripping
Posted by Jonathan Corbet 1 month, 3 weeks ago
By the time stuff gets to create_parameter_list(), comments have long since
been stripped out, so we do not need to do it again here.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
 scripts/lib/kdoc/kdoc_parser.py | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
index ceb38b59fb4c..900c028687cc 100644
--- a/scripts/lib/kdoc/kdoc_parser.py
+++ b/scripts/lib/kdoc/kdoc_parser.py
@@ -493,9 +493,6 @@ class KernelDoc:
             args = arg_expr.sub(r"\1#", args)
 
         for arg in args.split(splitter):
-            # Strip comments
-            arg = KernRe(r'/\*.*\*/').sub('', arg)
-
             # Ignore argument attributes
             arg = KernRe(r'\sPOS0?\s').sub(' ', arg)
 
-- 
2.50.1
Re: [PATCH 7/7] docs: kdoc: remove redundant comment stripping
Posted by Mauro Carvalho Chehab 1 month, 3 weeks ago
On Tue, 12 Aug 2025 13:57:48 -0600
Jonathan Corbet <corbet@lwn.net> wrote:

> By the time stuff gets to create_parameter_list(), comments have long since
> been stripped out, so we do not need to do it again here.
> 
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
>  scripts/lib/kdoc/kdoc_parser.py | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index ceb38b59fb4c..900c028687cc 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -493,9 +493,6 @@ class KernelDoc:
>              args = arg_expr.sub(r"\1#", args)
>  
>          for arg in args.split(splitter):
> -            # Strip comments
> -            arg = KernRe(r'/\*.*\*/').sub('', arg)
> -
>              # Ignore argument attributes
>              arg = KernRe(r'\sPOS0?\s').sub(' ', arg)
>  

Didn't check, but yeah, there are some places already doing
it, so:

Acked-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


Thanks,
Mauro