Skip to content

Commit 08b8dc4

Browse files
author
Jonathan Corbet
committed
docs: kdoc: straighten up dump_declaration()
Get rid of the excess "return" statements in dump_declaration(), along with a line of never-executed dead code. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
1 parent a0db205 commit 08b8dc4

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

scripts/lib/kdoc/kdoc_parser.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -878,18 +878,13 @@ def dump_declaration(self, ln, prototype):
878878

879879
if self.entry.decl_type == "enum":
880880
self.dump_enum(ln, prototype)
881-
return
882-
883-
if self.entry.decl_type == "typedef":
881+
elif self.entry.decl_type == "typedef":
884882
self.dump_typedef(ln, prototype)
885-
return
886-
887-
if self.entry.decl_type in ["union", "struct"]:
883+
elif self.entry.decl_type in ["union", "struct"]:
888884
self.dump_struct(ln, prototype)
889-
return
890-
891-
self.output_declaration(self.entry.decl_type, prototype,
892-
entry=self.entry)
885+
else:
886+
# This would be a bug
887+
self.emit_message(ln, f'Unknown declaration type: {self.entry.decl_type}')
893888

894889
def dump_function(self, ln, prototype):
895890
"""

0 commit comments

Comments
 (0)