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: remove the KernelEntry::is_kernel_comment member

entry::is_kernel_comment never had anything to do with the entry itself; it
is a bit of local state in one branch of process_name(). It can, in fact,
be removed entirely; rework the code slightly so that it is no longer
needed.

No change in the rendered output.

Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Link: https://lore.kernel.org/r/20250606163438.229916-6-corbet@lwn.net

+8 -8
+8 -8
scripts/lib/kdoc/kdoc_parser.py
··· 1224 1224 1225 1225 if doc_decl.search(line): 1226 1226 self.entry.identifier = doc_decl.group(1) 1227 - self.entry.is_kernel_comment = False 1228 1227 1229 1228 decl_start = str(doc_com) # comment block asterisk 1230 1229 fn_type = r"(?:\w+\s*\*\s*)?" # type (for non-functions) ··· 1241 1242 if r.search(line): 1242 1243 self.entry.decl_type = r.group(1) 1243 1244 self.entry.identifier = r.group(2) 1244 - self.entry.is_kernel_comment = True 1245 1245 # 1246 1246 # Look for a function description 1247 1247 # 1248 1248 elif r2.search(line): 1249 1249 self.entry.identifier = r2.group(1) 1250 1250 self.entry.decl_type = "function" 1251 - self.entry.is_kernel_comment = True 1251 + # 1252 + # We struck out. 1253 + # 1254 + else: 1255 + self.emit_msg(ln, 1256 + f"This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst\n{line}") 1257 + self.state = state.NORMAL 1258 + return 1252 1259 1253 1260 self.entry.identifier = self.entry.identifier.strip(" ") 1254 1261 ··· 1275 1270 self.state = state.BODY_MAYBE 1276 1271 else: 1277 1272 self.entry.declaration_purpose = "" 1278 - 1279 - if not self.entry.is_kernel_comment: 1280 - self.emit_msg(ln, 1281 - f"This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst\n{line}") 1282 - self.state = state.NORMAL 1283 1273 1284 1274 if not self.entry.declaration_purpose and self.config.wshort_desc: 1285 1275 self.emit_msg(ln,