From nobody Sat Feb 7 21:14:35 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 C77E42C11D5; Mon, 12 Jan 2026 15:08:07 +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=1768230487; cv=none; b=ch8AH515XyLXU22xg1MqMnwoz7yunYEuXmSrTxYf3IQ50ceutLgoYzWhXBEJkFnmYvAzuVi3l9TDfd7D+YjIWfWaP0i9UBU5vEdGuHpiqPKcC3nPufsNk3C1KDDu3EP0Oowj5BilbOM0jLDSgGnyXYV0OM1bNlPNFfDdzHxKbIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768230487; c=relaxed/simple; bh=z88sTeFfUqwT1Sl7+wGd+pah5LIlpO5VdoqCx8UsYkI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Lztko1giT6BwLI2p5RG1wVigeTB7V5cBI1unvUC3ywHtjPNv9Blm7RqShlYFLkgjJWzaMaGYzLHjyh54M/clMPLpJEsohbZLb2OcRnc2p6UqtplaM66PAFb+/SAavkN0VAik7IKdjuczW1YNGF3SNOnaFY4uXHLmU2V8NHKhEwA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Ws0oDdcz; 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="Ws0oDdcz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 708EFC4AF09; Mon, 12 Jan 2026 15:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768230487; bh=z88sTeFfUqwT1Sl7+wGd+pah5LIlpO5VdoqCx8UsYkI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ws0oDdczja0Qb/XtQ9VnWWv4tqsv2MaZcvUO5DnPgwwGDsab93x4VDWPx52JloVFC ehyE/V+lH+1DwDIi3Ao6ggv+xjbn232Ufro7xw2czZFy8kZbKnGb07jlsayWYLHFtE 1LR8c3IN5BFauqK1cPvF1nw7oj/Kd9QFbUFC6V2IKazkA/3EXCyStIBx0f2J3s85Un Za1kOzLq5iB3ZEmK+e0F7iak76jLZQuhiqv93fBX3mqqDmXb+0rYC1onv4bOeOTxp5 SR57fG+srgQNsxxhVvwHvG0YYR8dXPUAX/tlD+roZDp4yzmKDFfnTS8Nl9tLURwTtQ WOdZ6UeWXwPEg== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfJWX-00000000JWm-2pB6; Mon, 12 Jan 2026 16:08:05 +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 v2 1/4] scripts/kernel-doc: fix logic to handle unissued warnings Date: Mon, 12 Jan 2026 16:06:50 +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 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 Sat Feb 7 21:14:35 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 C76EE24A07C; Mon, 12 Jan 2026 15:08:07 +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=1768230487; cv=none; b=aoggwnwuyLiahO5jCFUl31ogKsjdL5xUuw/nhjPi0MC5WAGsWoyjqKfUviClobOTvYYwQSt8Xlrbz0iYWTmcTEKufZve02k3mv5FlqklBEvDMM9HREDuzhmfp1ISkzW9M+qVjj1si1tJ/RJ3PBB04e/7mrrtK0lVEBbrW0WvjTg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768230487; c=relaxed/simple; bh=efaAoQJ46q/MA7bC6BpXipDb0T3zDwPIKRwh3uhkakE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TXuKSiAcFS/botL/1ioXdQ91r5IR4GzyjNNnsc89/BwimGhO4h5dpyfUwncTBtK7H2N17jdQ68uvVHpe/QeqcoJqHV3myokrT2SufmgaTxOLSNATIaHk2iMA8OMnqYqK4wHtNl9uSu/6EyEuidbxnpPuoSL2mhD/T2sG6Kypa3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=LkjbItZ+; 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="LkjbItZ+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72A70C19424; Mon, 12 Jan 2026 15:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768230487; bh=efaAoQJ46q/MA7bC6BpXipDb0T3zDwPIKRwh3uhkakE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LkjbItZ+1RIo9EN+ZfuO1cglb8iIEPZJysYmwGsp9M+abK6EyLkTOUYHGtmIaKYXi RK4946RKw5GlUcYO31ELvxXVPRT6Gwb3VTzF2VVgVPO2j4W7pcAmGPBNvcl2EMhwaO DN/7Qxg2jX66CXDnJgBj9gt4pw+evTg/tSgG0RDPsQ50R4raUgiUnuJc97kehnbdH5 mckCS9Eo6FRsuMbUGupOr+6zyeWOk9nrqKABrsxb6YjQotxFwPVelnLagSTd58IYVq +vbksYNjQD2cxXuMBZV2OszPSCvMhK6jk4sW5umpW/NG9ebhAvRUs7PQ7qKRyNFNYE MHP72fR2FWB8Q== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfJWX-00000000JWq-2w5B; Mon, 12 Jan 2026 16:08:05 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jani Nikula , Mauro Carvalho Chehab Subject: [PATCH v2 2/4] scripts/kernel-doc: avoid error_count overflows Date: Mon, 12 Jan 2026 16:06:51 +0100 Message-ID: <32749671865f095a5e981f36bf380771a83f3b09.1768229902.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 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 | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index 7a1eaf986bcd..5d2f29e90ebe 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -116,6 +116,8 @@ SRC_DIR =3D os.path.dirname(os.path.realpath(__file__)) =20 sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR)) =20 +WERROR_RETURN_CODE =3D 3 + DESC =3D """ Read C language source or header FILEs, extract embedded documentation com= ments, and print formatted documentation to standard output. @@ -176,7 +178,21 @@ class MsgFormatter(logging.Formatter): return logging.Formatter.format(self, record) =20 def main(): - """Main program""" + """ + Main program + By default, the return value is: + + - 0: parsing warnings or Python version is not compatible with + kernel-doc. The rationale for the latter is to not break Linux + compilation on such cases; + + - 1: an abnormal condition happened; + + - 2: arparse issued an error; + + - 3: -Werror is used, and one or more unfiltered parse warnings + happened. + """ =20 parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawTextH= elpFormatter, description=3DDESC) @@ -323,16 +339,12 @@ def main(): =20 if args.werror: print("%s warnings as errors" % error_count) # pylint: disable= =3DC0209 - sys.exit(error_count) + sys.exit(WERROR_RETURN_CODE) =20 if args.verbose: print("%s errors" % error_count) # pylint: disable= =3DC0209 =20 - 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 Sat Feb 7 21:14:35 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 C785E2DCBE6; Mon, 12 Jan 2026 15:08:07 +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=1768230487; cv=none; b=tDTC+fORw9W8JYL5Ib3o2YT/hcyAFLH6yFe9JCyRjmUwbMkppABtXAAX0sRAP2977vlOTwf4GBkQvxC2/ezf6gren3OwCA4eb+neCSQvHQRE8TTO6x+KlwQwRCzaQtLJxSD5Ak8WfCNvsPWy2fcvYOMDgvAB0frCYnyg9hHpwo0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768230487; c=relaxed/simple; bh=XChoitCpPvUu9DSulv7Knff2zjJ8XDFrF6Ndhe2QeNw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=SoF30QNr3zHNg4LqlLrgQPVzGxh83nDU4u4iKvZioXgQNPXG2r0iLlmKd0WhNwFEdaab6qSSJ8eVdLBHQo+xvwyb6pgpuWp5E0Dp1he+/Ajfb2EVB26jMcs4gezAy29VycQq5kzwNZp+2WdO2Z5ogTe8DtmHVY4M/HOoUUn3zJw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=O3BL1tfo; 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="O3BL1tfo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E6B4C19422; Mon, 12 Jan 2026 15:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768230487; bh=XChoitCpPvUu9DSulv7Knff2zjJ8XDFrF6Ndhe2QeNw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O3BL1tfosJBTJkj45T+uShqe850nExpFMwx55OTNtl7GRdFzFwvoX7WU8XjH63qHN aW/FF5ijAyeqvI30kegPbFsxmlzoaG+jg6z7JhN1wZq0vJpDkTjzPmwPvp9MfRSrEH 6n4myo5l+LxUbc0oU6fe46N3jwkV7FREQQeDo4JpMCquUrQ0j89sBE1bzsv+PU86gA dTXVK9sH0BfXlUR1iPujT9LtQZEunj/tlRqVNqYeyl/u5yeWxX2dBezqG9wMbHNH3z FiOEqOuIWvEg1YFZu38GsiG6Eu5AxZsl8YC2Of1I/P6Zai5VMLPq9xhtmSUPOJHGzq 0K5IGt9nQp6gw== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfJWX-00000000JWu-32zi; Mon, 12 Jan 2026 16:08:05 +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 v2 3/4] scripts/kernel-doc: ensure that comments are using our coding style Date: Mon, 12 Jan 2026 16:06:52 +0100 Message-ID: <7604a45e8ade06994afeb68616cf1838dd1101ec.1768229902.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 5d2f29e90ebe..7ccee4626478 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -197,7 +197,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.") @@ -213,7 +215,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.") @@ -235,7 +239,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 @@ -248,7 +254,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() @@ -262,7 +270,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 @@ -295,9 +305,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) @@ -307,7 +319,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(): =20 sys.exit(0) =20 +# # Call main method +# if __name__ =3D=3D "__main__": main() --=20 2.52.0 From nobody Sat Feb 7 21:14:35 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 AA9F320010C; Mon, 12 Jan 2026 15:08:07 +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=1768230487; cv=none; b=YToR5LAD4gG5qYLCi9dBUXjhMUtmeDzwP9qEVI8eFW0gbOqEc6khcZyZ3+gcCgQpiGI/KZVqPiYGFb3hTBtNzdRhfL33VP+3iNLgEvBw0wCEhUe8KzGBo0zCcAmdLN9zhD7KGlsDD1QYL7c+TTsOgjrIRVX9JUa1NS/57j6eVCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768230487; c=relaxed/simple; bh=hQU7ILU8FGfaXvaPKyg+910Nis+bE1Jn3QGzXcDLK6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ryihij1y9TT5kxrkbU9MG4B0li81wgP4nyI4eSqGUPgolMcdlATYqe2BXXTTTGogrG4RWj5K3bE1Uqs7XR5StoT2TT5yUQg0Ud1UL2D5BUkbuZkmT8eUpYKaObfP8N6sVJafBSZOLZfNEKq8dl4o2ewvgv8mtvSkXfoktqJM75Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jRrIoLMC; 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="jRrIoLMC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B899C2BC87; Mon, 12 Jan 2026 15:08:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768230487; bh=hQU7ILU8FGfaXvaPKyg+910Nis+bE1Jn3QGzXcDLK6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRrIoLMCKVWEGF9ZRLav5Ao9MtRvcKlYYwVveu0mddM32Fx/HVZqU6n5jq9X51qIU GJUBXOAIDaUj718bGbXEBT2rPwGmJQTZAJWb7NNq7Hmrn5/ttGvTg3lZcPKYpZ4Inh b1KtlH7Kt15I5Av2Pq09Aum3hv0G9cJTQNZC4uuZyKAVB/giA+a6gIR+2a/GckPJS1 W3eZOXZpfc8OONHx9YouLECadzlHciS21hfz35CBf+fYi2h4ce46hdWrakjgqx639+ j5l8GloXnqTUtb1n0DLdlDWDgVAwprp/0NTZw4+ezVsY4Uxq1o2uvOQOACOPMExZ/A ZgL0YDlHIwisw== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfJWX-00000000JWy-39ts; Mon, 12 Jan 2026 16:08:05 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jani Nikula , Mauro Carvalho Chehab Subject: [PATCH v2 4/4] scripts/kernel-doc: some fixes to kernel-doc comments Date: Mon, 12 Jan 2026 16:06:53 +0100 Message-ID: <1ea812db44c941dcbdead57cd34ccd807261c436.1768229902.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 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 7ccee4626478..28ec5500f664 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-strings 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: # @@ -134,13 +134,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. """ @@ -163,7 +163,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. @@ -171,7 +171,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() @@ -277,7 +277,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) @@ -306,12 +306,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 3.6 or later is required by kernel-doc. S= kipping checks") sys.exit(0) =20 sys.exit("Python 3.6 or later is required by kernel-doc. Aborting.= ") @@ -320,7 +320,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