From nobody Wed Feb 11 07:48:28 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49C00356A1E; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; cv=none; b=CiKO5UCmatu7dZol0C9rMnzOgWDvCWZ/H/aGBMvlyk++w0hZLo56h9yNpFDjZIWNyp9+ewxBB6DnLQ17XVOfV4TgEHZ4rtSiCF6L1i+85wySRKr5gNAH6zVXSntVt6cWSKtNuAV/7sg7nCsV8X9WEmAK2vBI5/D/vhTMYzOxu70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; c=relaxed/simple; bh=M8CQBtXD5x5BId0iNs+suDaY/SBqip9p2vko/lQ8Y1M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KHQ3e/IKVZtGxRyQ6KNALRVyZlcDL4sNlSFeHIHwphdye25aqxcEHZmovrUJI0wr8soJHCoinKW8G3seIzfWIQY7CrBInWpOg2r40r8iuURAAiQF7jcd0UbkjqGZN7r3Cq9A+FHPGPTTHth1yPd+p5zJ/QayU81D1WItN5nbssw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VJ2PCPpZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VJ2PCPpZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04916C19421; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768217036; bh=M8CQBtXD5x5BId0iNs+suDaY/SBqip9p2vko/lQ8Y1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VJ2PCPpZKwRx9Og7IO00VWIwe1CvaMFO8ve5wY1lHDK67zVQs4WAU/jcGqVLUW+2T Ibd7bk7LepDx3o/gYDnxpSfe/vexxZy5qdUl00v2QETyZ+4qBg2FJdHZRK9sylYDPQ wsVEGBRDnUQ6CrnghxwLoNo2vUOWC9ru3mN0K3xjeZDFhNfR+5pU/fxnTcfO2JEI/K 7i/w4eOTxFYP2/QpXd0eqwEcfxTKokJlYPbqSDgY0Pzm5k/sWau9pUdQDThigkvYsX uSxWLFCrDR8sr1mrI/PO7Pe3FU7Xt3TATYJ23OhI2BiWaReG5Y3Vj/63KNyMbNPO/v ql0x5FnxyAqdw== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfG1a-00000000DTi-0mD3; Mon, 12 Jan 2026 12:23:54 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Andy Shevchenko , Jani Nikula , Jonathan Corbet , Mauro Carvalho Chehab , Randy Dunlap Subject: [PATCH 1/4] scripts/kernel-doc: fix logic to handle unissued warnings Date: Mon, 12 Jan 2026 12:23:23 +0100 Message-ID: <914b07e496fd204d7082c6e1b138d99d8488da9b.1768216455.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Changeset 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently disc= arded") didn't properly addressed the missing messages behavior, as it was calling directly python logger low-level function, instead of using the expected method to emit warnings. Basically, there are two methods to log messages: - self.config.log.warning() - This is the raw level to emit a warning. It just writes the a message at stderr, via python logging, as it is initialized as: self.config.log =3D logging.getLogger("kernel-doc") - self.config.warning() - This is where we actually consider a message as a warning, properly incrementing error count. Due to that, several parsing error messages are internally considered as success, causing -Werror to not work on such messages. While here, ensure that the last ignored entry will also be handled by adding an extra check at the end of the parse handler. Fixes: 469c1c9eb6c9 ("kernel-doc: Issue warnings that were silently discard= ed") Closes: https://lore.kernel.org/linux-doc/20260112091053.00cee29a@foz.lan/ Signed-off-by: Mauro Carvalho Chehab Acked-by: Andy Shevchenko --- tools/lib/python/kdoc/kdoc_parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index a9a37519145d..aed07fdaa561 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -459,7 +459,7 @@ class KernelDoc: # if self.entry and self.entry not in self.entries: for log_msg in self.entry.warnings: - self.config.log.warning(log_msg) + self.config.warning(log_msg) =20 self.entry =3D KernelEntry(self.config, self.fname, ln) =20 @@ -1741,6 +1741,10 @@ class KernelDoc: # Hand this line to the appropriate state handler self.state_actions[self.state](self, ln, line) =20 + if self.entry and self.entry not in self.entries: + for log_msg in self.entry.warnings: + self.config.warning(log_msg) + except OSError: self.config.log.error(f"Error: Cannot open file {self.fname}") =20 --=20 2.52.0 From nobody Wed Feb 11 07:48:28 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49CFB356A1F; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; cv=none; b=sWrd977JUaaGXjJauyz/aQkaQRwFg/AbaWPfy9Uj2zjU6xNSv3GYh0/i8jBUpvyiEWBNXEn9N18tf/WKC7gV/4ma4tWlFJBQoVhZxHnX7v5+cd21qnniySn7JsI71LMljUvKv1u8DEPsSHqa2N2kVplmfQwgLpaEisJKxlZ2IU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; c=relaxed/simple; bh=+lKeuLhTf7AU/sOR7BZ3YNtBXxJWLuRjIlJ5L7U7ggc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=f6NmwvxsqFunitup+PwgcvHc3IE+M/rUhIJ+XwsEeF32qEbHRVvbjSjBvpFZKOPnqJL7oQsrkLBuYPIaghYgxUpCbWwJv9HhPwEZnoc4CahuNxGWgAscU+jStmBkEP213RpMNsYeibPNQ6TJyVqRUzBwO+1cjhZ7jBwxqe7HPGI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M7XbkGCE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M7XbkGCE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04944C19422; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768217036; bh=+lKeuLhTf7AU/sOR7BZ3YNtBXxJWLuRjIlJ5L7U7ggc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7XbkGCEWSXWUsXDuonazQSbzqRGmb1S75byvKBLVhq+byuOdBs3LxpvRVO7OKchb cHCejjzGwB0c5PYDQtkoDNvkuXuPTL191EJJpC6LFW257rDKQrnNAV80zg5mvWRFLn T8caJaYDeSJQMfZuwW/RDsZUrzYyDhn9yLC+H53VFDGB8u7hH/QFUbNcCmESooyrCt WAqvaqXN5XLCn28U8Xje2Rcrgiy4BkocXq6/1nWJXcr1zG8+j0XYorY52nQ85ZL6AU mgMa6Lx4WAeVLOvfrojoP2ZVH2CV1lbomXXgf+5Bh5969IqaiLcOaB5CW8g4nRO64m XZjcfc+E1Yy1g== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfG1a-00000000DTm-0sz9; Mon, 12 Jan 2026 12:23:54 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jani Nikula , Jonathan Corbet Subject: [PATCH 2/4] scripts/kernel-doc: avoid error_count overflows Date: Mon, 12 Jan 2026 12:23:24 +0100 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab The glibc library limits the return code to 8 bits. We need to stick to this limit when using sys.exit(error_count). Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index 7a1eaf986bcd..600bdfea6a96 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -176,7 +176,14 @@ class MsgFormatter(logging.Formatter): return logging.Formatter.format(self, record) =20 def main(): - """Main program""" + """ + Main program + By default, the return value is zero on parsing errors or when the + Python version is not compatible with kernel-doc. The rationale is + to not break Linux compilation on such cases. + If -Werror is used, it will return the number of parse errors, up to + 255 errors, as this is the maximum value allowed by glibc. + """ =20 parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawTextH= elpFormatter, description=3DDESC) @@ -321,18 +328,23 @@ def main(): if not error_count: sys.exit(0) =20 + if args.verbose: + print("%s errors" % error_count) # pylint: disable= =3DC0209 + + if args.werror: print("%s warnings as errors" % error_count) # pylint: disable= =3DC0209 + + # + # Return code is 8-bits, as seen at: + # https://www.gnu.org/software/libc/manual/html_node/Exit-Status= .html + # Truncate to avoid overflow + # + if error_count > 255: + error_count =3D 255 + sys.exit(error_count) - - if args.verbose: - print("%s errors" % error_count) # pylint: disable= =3DC0209 - - if args.none: - sys.exit(0) - - sys.exit(error_count) - + sys.exit(0) =20 # Call main method if __name__ =3D=3D "__main__": --=20 2.52.0 From nobody Wed Feb 11 07:48:28 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49EDB356A23; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; cv=none; b=XB+ltxQqqsj7pVjv8JGa+yJXL4yjXbpW81rYg5kjYTK2whcLtRTfGCgRisF9E2e4YClzrgOBwSFRLPjThz0YLwLMx+HQGoj3rynsOzvD8k3NgMLPx4LF5eWajRU0LvZLCvt/NzYVAUWNgBe50Su/R+qsvUBd3keb5HssGLFJidI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; c=relaxed/simple; bh=lGP3YEIb7htsUIa6dUl9swOOUdUMERQ+4bISrWtBkd0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=snKAEhDujQ8CSwuXQBcj2Wbg0iuANf0OTUKnA/fSYn8/rUBc7vthpiFs6fimBSzfMX1UauhXtth6KS61odBPUHWYjnVMr7WirJHVIsUn69PLRp+bXbBrehIVw5m7WWsptJwHt8ZAIdnTRGMl05KZgFNLODBQBXmIDJKzcJeKEpY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NoLEE09u; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NoLEE09u" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08851C16AAE; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768217036; bh=lGP3YEIb7htsUIa6dUl9swOOUdUMERQ+4bISrWtBkd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NoLEE09uLOySikVTg45OD9Um6kIeH++3YOMbBoFLiq71ctPhuDWBEFfjHBp6bKQLC GrSMSCQvHv3q5vQuYWnnWQVO1RUx1iSW3+gg1flOa3LEszlgtHYOMwJPEvICE4YbXo KSlTacvfzR1164ynSCT9NV/7D6XLeuDVwh6OjW5yC+NaBEyFTPDsIzYuUkr3g67Aue nT+TjxomTSxndDzuIMylAXalyEUUy3UGd+tcc3Z41VTkVrBZ7igjHc/DEqX47pyGkO tjNMKYZSdz29lUE0i/86z6rhGQNAaOR6IqjuGx7li8jNrQpZhSsCYjlM4DIyPZUaW8 exGXwDa8M+f0g== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfG1a-00000000DTq-0zhi; Mon, 12 Jan 2026 12:23:54 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jani Nikula , Jonathan Corbet Subject: [PATCH 3/4] scripts/kernel-doc: ensure that comments are using our coding style Date: Mon, 12 Jan 2026 12:23:25 +0100 Message-ID: <8dab4a0fff5b7054f45965e6289a7541a2a72c10.1768216455.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Along kernel-doc libs, we opted to have all comments starting/ending with a blank comment line. Use the same style here. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index 600bdfea6a96..bcb60136fc9c 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -188,7 +188,9 @@ def main(): parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawTextH= elpFormatter, description=3DDESC) =20 + # # Normal arguments + # =20 parser.add_argument("-v", "-verbose", "--verbose", action=3D"store_tru= e", help=3D"Verbose output, more warnings and other in= formation.") @@ -204,7 +206,9 @@ def main(): action=3D"store_true", help=3D"Enable line number output (only in ReST mo= de)") =20 + # # Arguments to control the warning behavior + # =20 parser.add_argument("-Wreturn", "--wreturn", action=3D"store_true", help=3D"Warns about the lack of a return markup on= functions.") @@ -226,7 +230,9 @@ def main(): parser.add_argument("-export-file", "--export-file", action=3D'append', help=3DEXPORT_FILE_DESC) =20 + # # Output format mutually-exclusive group + # =20 out_group =3D parser.add_argument_group("Output format selection (mutu= ally exclusive)") =20 @@ -239,7 +245,9 @@ def main(): out_fmt.add_argument("-N", "-none", "--none", action=3D"store_true", help=3D"Do not output documentation, only warning= s.") =20 + # # Output selection mutually-exclusive group + # =20 sel_group =3D parser.add_argument_group("Output selection (mutually ex= clusive)") sel_mut =3D sel_group.add_mutually_exclusive_group() @@ -253,7 +261,9 @@ def main(): sel_mut.add_argument("-s", "-function", "--symbol", action=3D'append', help=3DFUNCTION_DESC) =20 + # # Those are valid for all 3 types of filter + # parser.add_argument("-n", "-nosymbol", "--nosymbol", action=3D'append', help=3DNOSYMBOL_DESC) =20 @@ -286,9 +296,11 @@ def main(): =20 python_ver =3D sys.version_info[:2] if python_ver < (3,6): + # # Depending on Kernel configuration, kernel-doc --none is called at # build time. As we don't want to break compilation due to the # usage of an old Python version, return 0 here. + # if args.none: logger.error("Python 3.6 or later is required by kernel-doc. s= kipping checks") sys.exit(0) @@ -298,7 +310,9 @@ def main(): if python_ver < (3,7): logger.warning("Python 3.7 or later is required for correct result= s") =20 + # # Import kernel-doc libraries only after checking Python version + # from kdoc.kdoc_files import KernelFiles # pylint: disable= =3DC0415 from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable= =3DC0415 =20 @@ -346,6 +360,8 @@ def main(): sys.exit(error_count) sys.exit(0) =20 +# # Call main method +# if __name__ =3D=3D "__main__": main() --=20 2.52.0 From nobody Wed Feb 11 07:48:28 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49E2B356A22; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; cv=none; b=SPsOzbWUZPoVEcgsqHnuBpCLPobocesvU2gxeVuqkfcnz9ZooGah1fjoCP+n1MwPJLhtZw02FXl3zld2KRTH0aew/thFtm22xXM5vlhiiDMO6JbY89DXH5gIgzXwrRSSr89f/AY2tX8ji34rHd/XRbBCBDdyhowZpkVV7aRag5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768217036; c=relaxed/simple; bh=b7TCaIVKIIOx690781eq+Ut++2/njLJoNV6BCi2juqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WSe2Fw4rmbORdq/MDsOt8EmogKgt6vbSBzn2Dh55HksiqiXtP+o/e0tYo1rj39b3nB415Oe/Rfv0kt/SGMMfYkGL0ebghvXTkL6v5y+3+T9OY1AYBkA6+adDfHJ4IpTH/Q/LuAefll+Q1J0oPw2GoG61y4oyml3ce9nrm0Y7h3E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mTrGV1f5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mTrGV1f5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D752C19424; Mon, 12 Jan 2026 11:23:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768217036; bh=b7TCaIVKIIOx690781eq+Ut++2/njLJoNV6BCi2juqc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mTrGV1f5ePDMoVaQ3k1cAOJl65R0X6JYtcGKNUKyK6gaX4WMdZK6ywbOHZI3Tfth+ y34Z7w/j8zq3Cnft/xGA3931BqG6huwynxlzq6qRJQd5oi+QFxnEiNi+9rt1L7vytZ DWgyLwOawGV66B4BCltI9Otucn3mRef4p1D62u8UgD4KOAzhNu34yna/I/Oxv1Bo3/ nTOKv0bemH1W+d/1JQGlxckatqz6GPxTDGjsGx17F1pySQjMjmVL/7bqs/8DwH4VSZ qsseGPrO2I/LMgUQrITqcIwoe5Vl2nPbJYTE7kbh51OFaB+W3Hxwm4O5nXnc3omnIt NJaCEubGzIAvQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfG1a-00000000DTu-16QV; Mon, 12 Jan 2026 12:23:54 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jani Nikula , Jonathan Corbet Subject: [PATCH 4/4] scripts/kernel-doc: some fixes to kernel-doc comments Date: Mon, 12 Jan 2026 12:23:26 +0100 Message-ID: X-Mailer: git-send-email 2.52.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab There are some typos and English errors at the kernel-doc.py comments. Locate them with the help of LLM (gpt-oss 14B), locally excecuted with this prompt: review English grammar andsyntax at the comments on the code below: Not all results are flowers, although it caught several minor issues there. Add the pertinent fixes, discarding the bad ones. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index bcb60136fc9c..5086248ee532 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -9,10 +9,10 @@ # The rationale is that it shall fail gracefully during Kernel # compilation with older Kernel versions. Due to that: # - encoding line is needed here; -# - no f-strings can be used on this file. -# - the libraries that require newer versions can only be included -# after Python version is checked. - +# - f=E2=80=91strings cannot be used in this file. +# - libraries that require newer versions can only be included +# after the Python version has been checked. +# # Converted from the kernel-doc script originally written in Perl # under GPLv2, copyrighted since 1998 by the following authors: # @@ -132,13 +132,13 @@ May be used multiple times. """ =20 EXPORT_DESC =3D """ -Only output documentation for the symbols that have been +Only output documentation for symbols that have been exported using EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE. """ =20 INTERNAL_DESC =3D """ -Only output documentation for the symbols that have NOT been +Only output documentation for symbols that have NOT been exported using EXPORT_SYMBOL() and related macros in any input FILE or -export-file FILE. """ @@ -161,7 +161,7 @@ Header and C source files to be parsed. """ =20 WARN_CONTENTS_BEFORE_SECTIONS_DESC =3D """ -Warns if there are contents before sections (deprecated). +Warn if there are contents before sections (deprecated). =20 This option is kept just for backward-compatibility, but it does nothing, neither here nor at the original Perl script. @@ -169,7 +169,7 @@ neither here nor at the original Perl script. =20 =20 class MsgFormatter(logging.Formatter): - """Helper class to format warnings on a similar way to kernel-doc.pl""" + """Helper class to format warnings in a similar way to kernel-doc.pl."= "" =20 def format(self, record): record.levelname =3D record.levelname.capitalize() @@ -268,7 +268,7 @@ def main(): help=3DNOSYMBOL_DESC) =20 parser.add_argument("-D", "-no-doc-sections", "--no-doc-sections", - action=3D'store_true', help=3D"Don't outputt DOC s= ections") + action=3D'store_true', help=3D"Don't output DOC se= ctions") =20 parser.add_argument("files", metavar=3D"FILE", nargs=3D"+", help=3DFILES_DESC) @@ -297,12 +297,12 @@ def main(): python_ver =3D sys.version_info[:2] if python_ver < (3,6): # - # Depending on Kernel configuration, kernel-doc --none is called at + # Depending on the Kernel configuration, kernel-doc --none is call= ed at # build time. As we don't want to break compilation due to the # usage of an old Python version, return 0 here. # if args.none: - logger.error("Python 3.6 or later is required by kernel-doc. s= kipping checks") + logger.error("Python=C2=A03.6 or later is required by kernel= =E2=80=91doc. Skipping checks") sys.exit(0) =20 sys.exit("Python 3.6 or later is required by kernel-doc. Aborting.= ") @@ -311,7 +311,7 @@ def main(): logger.warning("Python 3.7 or later is required for correct result= s") =20 # - # Import kernel-doc libraries only after checking Python version + # Import kernel-doc libraries only after checking the Python version # from kdoc.kdoc_files import KernelFiles # pylint: disable= =3DC0415 from kdoc.kdoc_output import RestFormat, ManFormat # pylint: disable= =3DC0415 --=20 2.52.0