Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+5 -10
+5 -10
scripts/lib/kdoc/kdoc_parser.py
··· 878 878 879 879 if self.entry.decl_type == "enum": 880 880 self.dump_enum(ln, prototype) 881 - return 882 - 883 - if self.entry.decl_type == "typedef": 881 + elif self.entry.decl_type == "typedef": 884 882 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"]: 888 884 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}') 893 888 894 889 def dump_function(self, ln, prototype): 895 890 """