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: directly access the always-there KdocItem fields

They are part of the interface, so use them directly. This allows the
removal of the transitional __dict__ hack in KdocItem.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

+8 -13
+1 -4
scripts/lib/kdoc/kdoc_item.py
··· 23 23 self.other_stuff = other_stuff 24 24 25 25 def get(self, key, default = None): 26 - ret = self.other_stuff.get(key, default) 27 - if ret == default: 28 - return self.__dict__.get(key, default) 29 - return ret 26 + return self.other_stuff.get(key, default) 30 27 31 28 def __getitem__(self, key): 32 29 return self.get(key)
+7 -9
scripts/lib/kdoc/kdoc_output.py
··· 124 124 Output warnings for identifiers that will be displayed. 125 125 """ 126 126 127 - warnings = args.get('warnings', []) 128 - 129 - for log_msg in warnings: 127 + for log_msg in args.warnings: 130 128 self.config.warning(log_msg) 131 129 132 130 def check_doc(self, name, args): ··· 182 184 183 185 self.data = "" 184 186 185 - dtype = args.get('type', "") 187 + dtype = args.type 186 188 187 189 if dtype == "doc": 188 190 self.out_doc(fname, name, args) ··· 371 373 signature = args['functiontype'] + " " 372 374 signature += name + " (" 373 375 374 - ln = args.get('declaration_start_line', 0) 376 + ln = args.declaration_start_line 375 377 count = 0 376 378 for parameter in args.parameterlist: 377 379 if count != 0: ··· 443 445 def out_enum(self, fname, name, args): 444 446 445 447 oldprefix = self.lineprefix 446 - ln = args.get('declaration_start_line', 0) 448 + ln = args.declaration_start_line 447 449 448 450 self.data += f"\n\n.. c:enum:: {name}\n\n" 449 451 ··· 472 474 def out_typedef(self, fname, name, args): 473 475 474 476 oldprefix = self.lineprefix 475 - ln = args.get('declaration_start_line', 0) 477 + ln = args.declaration_start_line 476 478 477 479 self.data += f"\n\n.. c:type:: {name}\n\n" 478 480 ··· 490 492 491 493 purpose = args.get('purpose', "") 492 494 declaration = args.get('definition', "") 493 - dtype = args.get('type', "struct") 494 - ln = args.get('declaration_start_line', 0) 495 + dtype = args.type 496 + ln = args.declaration_start_line 495 497 496 498 self.data += f"\n\n.. c:{dtype}:: {name}\n\n" 497 499