aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorJonathan Corbet <[email protected]>2025-07-02 19:34:40 +0000
committerJonathan Corbet <[email protected]>2025-07-15 19:43:30 +0000
commit08b8dc43d18d5d0c4791cc630d5cddf98eaa51ea (patch)
treec88a393dba0cc597d291233262449ae25bc121c9 /scripts/lib
parentdocs: kdoc: Regularize the use of the declaration name (diff)
downloadkernel-08b8dc43d18d5d0c4791cc630d5cddf98eaa51ea.tar.gz
kernel-08b8dc43d18d5d0c4791cc630d5cddf98eaa51ea.zip
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 <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/kdoc/kdoc_parser.py15
1 files 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
-
- 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}')
def dump_function(self, ln, prototype):
"""