From nobody Tue Apr 7 23:44:00 2026 Received: from sonic303-3.consmr.mail.sg3.yahoo.com (sonic303-3.consmr.mail.sg3.yahoo.com [106.10.242.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 491D331A805 for ; Wed, 11 Mar 2026 14:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=106.10.242.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773240322; cv=none; b=I0JKfFZ09GsOiwXUN29cR6GZwIJhZeLcWJlemc0mKhfkHyWyioM5VSu2/lWBWJCmQpwroypbdn+Je2PG0Bo9emdVxIkhHyAMw4nJDevndvWUrB31w2a02ErbQ72JYMuZRCt6DAGx34JkAlrGHA/H31FYOR2xkIP/Tooc5g6kDm0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773240322; c=relaxed/simple; bh=JFcxEPgj1xlmmgj3TxIKt62oQ7l8bIgUz0SoKXj/czQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:References; b=nlzVMpoqTQ/DcksEgmOo3w4kjQZRWevoK61+BAb+5KikgZocpNE9HjwGsnZJ6FLlXoVeF6cvmLaRE5+kxyvc0sjct7qkZObI2LEfdz3SEkTbFAJdR6cN91X3nk/VfcXb9lwiQGgCPCYnCclp7RFpJff7NP98HpgGBRqPd8WEM04= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com; spf=pass smtp.mailfrom=myyahoo.com; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b=COj8BpGi; arc=none smtp.client-ip=106.10.242.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=myyahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=myyahoo.com header.i=@myyahoo.com header.b="COj8BpGi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=myyahoo.com; s=s2048; t=1773240318; bh=3HuIxEk3PFBjJBWd4hO27Kg7uaEcW17Zz9/0Q7zKJzA=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To; b=COj8BpGiM9FUKXEo3diybglEZw/uyqfDuWF1KN/HMb9WWdy6WngVSGCbBCrKyWOUn9Bdz/Z+DGIR7MPX4GRVmiDzUNGKr1r+Vo8aIQ0Oij+bRSgx6knVWCJaTWXOP0zWWdTY7YvM5HN+dsWkcnDYZ1+NwgKAQRL+g6aCznSOyejzPT1O3NLhOXa069LdpvpR/9bwBxARedl7xbSa8hLkKTTNkCMXmlsEZVWL8/hSChfRRqsHmOiQuAN1LjZzEZ1rBxnSTsPr/4n8CoIzP0a3dQAEyT5leAE3ytsmne1e124M5kLXL8l43ZNA49PJo7PMZ61FKHJkoQflne6yfGg5VQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1773240318; bh=G6PDMBXlhEXyYwG6qcsdOUwBzstWj10jxr84a1DUPvp=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Lj65HwKRd1UQ3Hgubq8xd1k9hbM70LGKWNW9CYM32lKVHknaZRMp69V55rgFDU8t1zJ2533BPSq4MQ+KqiSD65j+VYc5UxY9XzvaAok07sjsuIWupNYTwzd74Li4g5rdaHW20hraDgDmneeP6nlWV/WZl7Pwu7NZ91MgvKOIG7egP7cGbaVMo5o5ciXxVedXlSNp1COTRxONR5zSL9uSYm1LHRDtl2pJY4YEvZEnWT+D6lSC36VJi6joWqxha+8uoqyIekHADRkaDjWQlhKPGeH2tyCiavvQEByxwArSCniFGRcielDBIyb53As9XMFiJQV6/x5hcLv+YkoTh7D1jw== X-YMail-OSG: F4b7VLgVM1lUV5GvJcV7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qNdQgwImd2brOz6nJew9lh.i 7MbnDYYqTk3TCw9bi6PkXeJBQVDp3k.QhVBUpan2gUNhWoNPb2YjqwnKZ3QmAPRovo8s_EtWR X-Sonic-MF: X-Sonic-ID: fbc34de9-ab8c-4e88-9f6c-0306a0525e18 Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.sg3.yahoo.com with HTTP; Wed, 11 Mar 2026 14:45:18 +0000 Received: by hermes--production-sg3-6959968fbd-nblks (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 240b13a0fe82b9ca515cea0cd3c4b9f1; Wed, 11 Mar 2026 14:33:07 +0000 (UTC) From: Sanjai To: corbet@lwn.net Cc: mchehab+huawei@kernel.org, rdunlap@infradead.org, linux-kernel@vger.kernel.org, Sanjai Subject: [PATCH] scripts/lib/kdoc: apply pending TODO renames Date: Wed, 11 Mar 2026 20:02:55 +0530 Message-ID: <20260311143255.171980-1-sanjai@myyahoo.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable References: <20260311143255.171980-1-sanjai.ref@myyahoo.com> Content-Type: text/plain; charset="utf-8" The TODO comments requested these renames after the removal of kernel-doc.pl. kernel-doc.pl was removed in commit 683e8cbaba7f ("docs: remove kernel-doc.pl"), so the renames can now be applied: - rename emit_msg() to emit_message() - rename output_declaration() to store_declaration() Signed-off-by: Sanjai --- tools/lib/python/kdoc/kdoc_parser.py | 86 ++++++++++++++-------------- 1 file changed, 42 insertions(+), 44 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index ca00695b47b3..c4222445756b 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -300,8 +300,7 @@ class KernelEntry: """Returns a string with all content texts that were added.""" return '\n'.join(self._contents) + '\n' =20 - # TODO: rename to emit_message after removal of kernel-doc.pl - def emit_msg(self, ln, msg, *, warning=3DTrue): + def emit_message(self, ln, msg, *, warning=3DTrue): """Emit a message.""" =20 log_msg =3D f"{self.fname}:{ln} {msg}" @@ -350,7 +349,7 @@ class KernelEntry: if name in self.sections and self.sections[name] !=3D "": # Only warn on user-specified duplicate section names if name !=3D SECTION_DEFAULT: - self.emit_msg(self.new_start_line, + self.emit_message(self.new_start_line, f"duplicate section name '{name}'") # Treat as a new paragraph - add a blank line self.sections[name] +=3D '\n' + contents @@ -405,15 +404,15 @@ class KernelDoc: if (not python_warning and sys.version_info.major =3D=3D 3 and sys.version_info.minor < 7= ): =20 - self.emit_msg(0, + self.emit_message(0, 'Python 3.7 or later is required for correct res= ults') python_warning =3D True =20 - def emit_msg(self, ln, msg, *, warning=3DTrue): + def emit_message(self, ln, msg, *, warning=3DTrue): """Emit a message""" =20 if self.entry: - self.entry.emit_msg(ln, msg, warning=3Dwarning) + self.entry.emit_message(ln, msg, warning=3Dwarning) return =20 log_msg =3D f"{self.fname}:{ln} {msg}" @@ -431,8 +430,7 @@ class KernelDoc: if self.entry: self.entry.dump_section(start_new) =20 - # TODO: rename it to store_declaration after removal of kernel-doc.pl - def output_declaration(self, dtype, name, **args): + def store_declaration(self, dtype, name, **args): """ Store the entry into an entry array. =20 @@ -540,7 +538,7 @@ class KernelDoc: else: dname =3D f"{decl_type} member" =20 - self.emit_msg(ln, + self.emit_message(ln, f"{dname} '{param}' not described in '{decla= ration_name}'") =20 # Strip spaces from param so that it is one continuous string on @@ -594,7 +592,7 @@ class KernelDoc: if r.match(arg): param =3D r.group(1) else: - self.emit_msg(ln, f"Invalid param: {arg}") + self.emit_message(ln, f"Invalid param: {arg}") param =3D arg dtype =3D arg.replace(param, '') self.push_parameter(ln, decl_type, param, dtype, arg, decl= aration_name) @@ -609,7 +607,7 @@ class KernelDoc: if r.match(arg): param =3D r.group(1) else: - self.emit_msg(ln, f"Invalid param: {arg}") + self.emit_message(ln, f"Invalid param: {arg}") param =3D arg dtype =3D arg.replace(param, '') self.push_parameter(ln, decl_type, param, dtype, arg, decl= aration_name) @@ -670,7 +668,7 @@ class KernelDoc: dname =3D f"{decl_type} parameter" else: dname =3D f"{decl_type} member" - self.emit_msg(ln, + self.emit_message(ln, f"Excess {dname} '{section}' description in = '{decl_name}'") =20 def check_return_section(self, ln, declaration_name, return_type): @@ -688,7 +686,7 @@ class KernelDoc: return =20 if not self.entry.sections.get("Return", None): - self.emit_msg(ln, + self.emit_message(ln, f"No description found for return value of '{dec= laration_name}'") =20 def split_struct_proto(self, proto): @@ -858,12 +856,12 @@ class KernelDoc: # struct_parts =3D self.split_struct_proto(proto) if not struct_parts: - self.emit_msg(ln, f"{proto} error: Cannot parse struct or unio= n!") + self.emit_message(ln, f"{proto} error: Cannot parse struct or = union!") return decl_type, declaration_name, members =3D struct_parts =20 if self.entry.identifier !=3D declaration_name: - self.emit_msg(ln, f"expecting prototype for {decl_type} {self.= entry.identifier}. " + self.emit_message(ln, f"expecting prototype for {decl_type} {s= elf.entry.identifier}. " f"Prototype was for {decl_type} {declaration_nam= e} instead\n") return # @@ -887,7 +885,7 @@ class KernelDoc: self.create_parameter_list(ln, decl_type, members, ';', declaration_name) self.check_sections(ln, declaration_name, decl_type) - self.output_declaration(decl_type, declaration_name, + self.store_declaration(decl_type, declaration_name, definition=3Dself.format_struct_decl(decla= ration), purpose=3Dself.entry.declaration_purpose) =20 @@ -919,17 +917,17 @@ class KernelDoc: # OK, this isn't going to work. # else: - self.emit_msg(ln, f"{proto}: error: Cannot parse enum!") + self.emit_message(ln, f"{proto}: error: Cannot parse enum!= ") return # # Make sure we found what we were expecting. # if self.entry.identifier !=3D declaration_name: if self.entry.identifier =3D=3D "": - self.emit_msg(ln, + self.emit_message(ln, f"{proto}: wrong kernel-doc identifier on pr= ototype") else: - self.emit_msg(ln, + self.emit_message(ln, f"expecting prototype for enum {self.entry.i= dentifier}. " f"Prototype was for enum {declaration_name} = instead") return @@ -949,7 +947,7 @@ class KernelDoc: self.entry.parameterlist.append(arg) if arg not in self.entry.parameterdescs: self.entry.parameterdescs[arg] =3D self.undescribed - self.emit_msg(ln, + self.emit_message(ln, f"Enum value '{arg}' not described in enum '= {declaration_name}'") member_set.add(arg) # @@ -957,10 +955,10 @@ class KernelDoc: # for k in self.entry.parameterdescs: if k not in member_set: - self.emit_msg(ln, + self.emit_message(ln, f"Excess enum value '@{k}' description in '{= declaration_name}'") =20 - self.output_declaration('enum', declaration_name, + self.store_declaration('enum', declaration_name, purpose=3Dself.entry.declaration_purpose) =20 def dump_var(self, ln, proto): @@ -1027,13 +1025,13 @@ class KernelDoc: default_val =3D r.group(1) =20 if not declaration_name: - self.emit_msg(ln,f"{proto}: can't parse variable") + self.emit_message(ln,f"{proto}: can't parse variable") return =20 if default_val: default_val =3D default_val.lstrip("=3D").strip() =20 - self.output_declaration("var", declaration_name, + self.store_declaration("var", declaration_name, full_proto=3Dfull_proto, default_val=3Ddefault_val, purpose=3Dself.entry.declaration_purpose) @@ -1137,11 +1135,11 @@ class KernelDoc: # Parsing done; make sure that things are as we expect. # if not found: - self.emit_msg(ln, + self.emit_message(ln, f"cannot understand function prototype: '{protot= ype}'") return if self.entry.identifier !=3D declaration_name: - self.emit_msg(ln, f"expecting prototype for {self.entry.identi= fier}(). " + self.emit_message(ln, f"expecting prototype for {self.entry.id= entifier}(). " f"Prototype was for {declaration_name}() instead= ") return self.check_sections(ln, declaration_name, "function") @@ -1149,7 +1147,7 @@ class KernelDoc: # # Store the result. # - self.output_declaration(decl_type, declaration_name, + self.store_declaration(decl_type, declaration_name, typedef=3D('typedef' in return_type), functiontype=3Dreturn_type, purpose=3Dself.entry.declaration_purpose, @@ -1180,13 +1178,13 @@ class KernelDoc: args =3D r.group(3) =20 if self.entry.identifier !=3D declaration_name: - self.emit_msg(ln, + self.emit_message(ln, f"expecting prototype for typedef {self.entr= y.identifier}. Prototype was for typedef {declaration_name} instead\n") return =20 self.create_parameter_list(ln, 'function', args, ',', declarat= ion_name) =20 - self.output_declaration('function', declaration_name, + self.store_declaration('function', declaration_name, typedef=3DTrue, functiontype=3Dreturn_type, purpose=3Dself.entry.declaration_purpo= se) @@ -1199,15 +1197,15 @@ class KernelDoc: declaration_name =3D r.group(1) =20 if self.entry.identifier !=3D declaration_name: - self.emit_msg(ln, + self.emit_message(ln, f"expecting prototype for typedef {self.entr= y.identifier}. Prototype was for typedef {declaration_name} instead\n") return =20 - self.output_declaration('typedef', declaration_name, + self.store_declaration('typedef', declaration_name, purpose=3Dself.entry.declaration_purpo= se) return =20 - self.emit_msg(ln, "error: Cannot parse typedef!") + self.emit_message(ln, "error: Cannot parse typedef!") =20 @staticmethod def process_export(function_set, line): @@ -1291,7 +1289,7 @@ class KernelDoc: # We struck out. # else: - self.emit_msg(ln, + self.emit_message(ln, f"This comment starts with '/**', but isn't = a kernel-doc comment. Refer to Documentation/doc-guide/kernel-doc.rst\n{lin= e}") self.state =3D state.NORMAL return @@ -1315,23 +1313,23 @@ class KernelDoc: self.entry.declaration_purpose =3D "" =20 if not self.entry.declaration_purpose and self.config.wshort_d= esc: - self.emit_msg(ln, + self.emit_message(ln, f"missing initial short description on line:= \n{line}") =20 if not self.entry.identifier and self.entry.decl_type !=3D "en= um": - self.emit_msg(ln, + self.emit_message(ln, f"wrong kernel-doc identifier on line:\n{lin= e}") self.state =3D state.NORMAL =20 if self.config.verbose: - self.emit_msg(ln, + self.emit_message(ln, f"Scanning doc for {self.entry.decl_type} {s= elf.entry.identifier}", warning=3DFalse) # # Failed to find an identifier. Emit a warning # else: - self.emit_msg(ln, f"Cannot find identifier on line:\n{line}") + self.emit_message(ln, f"Cannot find identifier on line:\n{line= }") =20 def is_new_section(self, ln, line): """ @@ -1378,7 +1376,7 @@ class KernelDoc: # Look for doc_com + + doc_end: r =3D KernRe(r'\s*\*\s*[a-zA-Z_0-9:.]+\*/') if r.match(line): - self.emit_msg(ln, f"suspicious ending line: {line}") + self.emit_message(ln, f"suspicious ending line: {line}") =20 self.entry.prototype =3D "" self.entry.new_start_line =3D ln + 1 @@ -1414,7 +1412,7 @@ class KernelDoc: trim_whitespace(self.entry.declaration_purpose + ' ' += cont) else: # Unknown line, ignore - self.emit_msg(ln, f"bad line: {line}") + self.emit_message(ln, f"bad line: {line}") =20 =20 def process_special(self, ln, line): @@ -1466,7 +1464,7 @@ class KernelDoc: self.entry.add_text(cont[self.entry.leading_space:]) else: # Unknown line, ignore - self.emit_msg(ln, f"bad line: {line}") + self.emit_message(ln, f"bad line: {line}") =20 def process_body(self, ln, line): """ @@ -1480,7 +1478,7 @@ class KernelDoc: self.entry.add_text(cont) else: # Unknown line, ignore - self.emit_msg(ln, f"bad line: {line}") + self.emit_message(ln, f"bad line: {line}") =20 def process_inline_name(self, ln, line): """STATE_INLINE_NAME: beginning of docbook comments within a proto= type.""" @@ -1493,7 +1491,7 @@ class KernelDoc: self.dump_section() self.state =3D state.PROTO elif doc_content.search(line): - self.emit_msg(ln, f"Incorrect use of kernel-doc format: {line}= ") + self.emit_message(ln, f"Incorrect use of kernel-doc format: {l= ine}") self.state =3D state.PROTO # else ... ?? =20 @@ -1575,7 +1573,7 @@ class KernelDoc: tracepointargs =3D r.group(1) =20 if not tracepointname or not tracepointargs: - self.emit_msg(ln, + self.emit_message(ln, f"Unrecognized tracepoint format:\n{proto}\n") else: proto =3D f"static inline void trace_{tracepointname}({tracepo= intargs})" @@ -1689,7 +1687,7 @@ class KernelDoc: =20 if doc_end.search(line): self.dump_section() - self.output_declaration("doc", self.entry.identifier) + self.store_declaration("doc", self.entry.identifier) self.reset_state(ln) =20 elif doc_content.search(line): --=20 2.53.0