[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250710082556.35a909b2@foz.lan>
Date: Thu, 10 Jul 2025 08:25:56 +0200
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jonathan Corbet <corbet@....net>
Cc: linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, Akira Yokosawa
<akiyks@...il.com>
Subject: Re: [PATCH 09/12] docs: kdoc: straighten up dump_declaration()
Em Wed, 2 Jul 2025 16:35:21 -0600
Jonathan Corbet <corbet@....net> escreveu:
> Get rid of the excess "return" statements in dump_declaration(), along with
> a line of never-executed dead code.
>
> Signed-off-by: Jonathan Corbet <corbet@....net>
> ---
> scripts/lib/kdoc/kdoc_parser.py | 15 +++++----------
> 1 file changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/lib/kdoc/kdoc_parser.py b/scripts/lib/kdoc/kdoc_parser.py
> index 6e35e508608b..7191fa94e17a 100644
> --- a/scripts/lib/kdoc/kdoc_parser.py
> +++ b/scripts/lib/kdoc/kdoc_parser.py
> @@ -878,18 +878,13 @@ class KernelDoc:
>
> if self.entry.decl_type == "enum":
> self.dump_enum(ln, prototype)
> - return
> -
> - if self.entry.decl_type == "typedef":
> + elif self.entry.decl_type == "typedef":
> self.dump_typedef(ln, prototype)
> - return
> -
> - if self.entry.decl_type in ["union", "struct"]:
> + elif self.entry.decl_type in ["union", "struct"]:
> self.dump_struct(ln, prototype)
> - return
> -
The above LGTM.
> - self.output_declaration(self.entry.decl_type, prototype,
> - entry=self.entry)
> + else:
> + # This would be a bug
> + self.emit_message(ln, f'Unknown declaration type: {self.entry.decl_type}')
Hmm... Are you sure about that? If I'm not mistaken, this was used for
other types of arguments, like DOC: tags.
>
> def dump_function(self, ln, prototype):
> """
Thanks,
Mauro
Powered by blists - more mailing lists