From nobody Sun Feb 8 05:27:42 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 2DD972EC090; Tue, 13 Jan 2026 17:20:02 +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=1768324802; cv=none; b=qTkL886l3XACqaLZbsuuDOE3pfXONoFr/yi/SnNAEk2VXdPZoqsNIz/kkGIri3CrvvHQY1F4pyWfAf2F3T+IW923JuZ0CgDWNOOlvwXCvgxBd0pdfNPlkW5dQYsqVC/nmWpArIhcis6SkFzJbIY81a5lqFFi8iNtoVd2VkyZ3wc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768324802; c=relaxed/simple; bh=6oCaEi76Hg/UqsSDo++T7ZkfHrGDy79mODSERj/qBrE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HKS3uJNSPvFhUi7AM9UXiActSDJYi4Fh+3xBEFis9/hr28RptNbGUpQt/KPGmQE3VTaaiWwVQFzsOYX8WAma9AuEr8KJ2WXzgLc70cS6mDRjsDkevLsIGjNEEeXL23/+unSs8tX+BMJwfohvTugOwDfdNwCsvuxr3smwi13/L+8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s/YSxS+K; 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="s/YSxS+K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B35AEC19422; Tue, 13 Jan 2026 17:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768324801; bh=6oCaEi76Hg/UqsSDo++T7ZkfHrGDy79mODSERj/qBrE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s/YSxS+KKYX53pEUW33hfwwIKCK4mnEP+qNCi+tGRm0SNOPeLm/wxzvQQEuP0/CPe Yi9x2dX/EiD3+NaiV2nWhpW9yFx0m/LOLrMcpAm5rYZnz8PtIbavBhco6eJ47/B9VC hFfxKFrIpxGFhWhK0BOgSkOr+dxhhymW1qttFb1OmMea0AWxGM/8+v9HSG0GQfmXir vW9OV5eZ+1mQdT7D1tmmYuvxv8g2IbpvRfFPVRWrQAeisSAj8orVYqwVwT+WDKqHtA QqfmRmb2SCQlh0UtH75th4Zj5kb9d2bkzfFu+bnMu7nbvDomd91+mNvVwhvTpVMGsG 6moTl/w7tl7Bw== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfi3j-00000000ze8-3IeF; Tue, 13 Jan 2026 18:19:59 +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 , stable@vger.kernel.org Subject: [PATCH v3 1/4] scripts/kernel-doc: fix logic to handle unissued warnings Date: Tue, 13 Jan 2026 18:19:53 +0100 Message-ID: <9a3d93bbde9cd3cf5e4dd20ba4f65ef860af6792.1768324572.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/ Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab Acked-by: Andy Shevchenko --- tools/lib/python/kdoc/kdoc_parser.py | 31 ++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index a9a37519145d..4ad7ce0b243e 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -448,18 +448,35 @@ class KernelDoc: =20 self.config.log.debug("Output: %s:%s =3D %s", dtype, name, pformat= (args)) =20 + def emit_unused_warnings(self): + """ + When the parser fails to produce a valid entry, it places some + warnings under `entry.warnings` that will be discarded when resett= ing + the state. + + Ensure that those warnings are not lost. + + NOTE: Because we are calling `config.warning()` here, those + warnings are not filtered by the `-W` parameters: they will = all + be produced even when `-Wreturn`, `-Wshort-desc`, and/or + `-Wcontents-before-sections` are used. + + Allowing those warnings to be filtered is complex, because it + would require storing them in a buffer and then filtering th= em + during the output step of the code, depending on the + selected symbols. + """ + if self.entry and self.entry not in self.entries: + for log_msg in self.entry.warnings: + self.config.warning(log_msg) + def reset_state(self, ln): """ Ancillary routine to create a new entry. It initializes all variables used by the state machine. """ =20 - # - # Flush the warnings out before we proceed further - # - if self.entry and self.entry not in self.entries: - for log_msg in self.entry.warnings: - self.config.log.warning(log_msg) + self.emit_unused_warnings() =20 self.entry =3D KernelEntry(self.config, self.fname, ln) =20 @@ -1741,6 +1758,8 @@ class KernelDoc: # Hand this line to the appropriate state handler self.state_actions[self.state](self, ln, line) =20 + self.emit_unused_warnings() + except OSError: self.config.log.error(f"Error: Cannot open file {self.fname}") =20 --=20 2.52.0 From nobody Sun Feb 8 05:27:42 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 2DEC82FE042; Tue, 13 Jan 2026 17:20:02 +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=1768324802; cv=none; b=lJJ+b0zzU6LTxQEBNRiZSN9qSCVJFWnLtk5Oz5ZbvIPZaMyO62AfzccIL847yW1XRBZjryzV9pO+eHXWjSFIDlmmXufZONtvedt1TMRl331LJeipHaPWv+FELQEOM5OvIu3CYTAgD9Wi1w9uMkrXD3CwUfGFTeEiJGEbn5YM9YM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768324802; c=relaxed/simple; bh=UUmc3EfAY48oflOixuCJfyhKnkDnBsRLnIZJCLJ1PX4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oa1EwVTUc4NINiH2oTcieHQy0iLDzvjJJSUTqKZHxJjFC7auT3JpCzmpaKY88aUAym3hPkVxdD9GBaYCEZEXbrVxxy9g3rSkAvVykSox5uTMIgC9KRhhD5iXct8Q6Xzfj/zD5Q6tJkO3Nq5bc2gKBXPSkPne6eTsf8c1NJ9CWVo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qBWdEQoh; 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="qBWdEQoh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1628C116C6; Tue, 13 Jan 2026 17:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768324801; bh=UUmc3EfAY48oflOixuCJfyhKnkDnBsRLnIZJCLJ1PX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qBWdEQoheTARg8Y8d+o2uLj+NFHpoJWUSv0XaLTHT9esNRmDBGK/9YeTd+uSllvW6 fhOPzRqGkrfhqqHEUXPCoslASKKXm3RelZpVyqiFbNn+io82BKG4wLf/U80gS2RubY +2JyBEehausuQCHEIozWl9OOJjlqSwA0bZf9M0hEoAnM9pUP1oG+2KueyeyPYrbLDf mvhH5zdk4DqggUKi0S5pUEFvslDhSmc/bu7GvTP2N4m9yhMwbsvUvhTjLXLvI/snvy KQxSxxLi874+kRKa27fW0zKk+Ls3V3kSwqUQ/PEqmwTRFXVsJUfdQ2mOdDabGvNivB oA7uo5tQuxlqQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfi3j-00000000zeC-3PZb; Tue, 13 Jan 2026 18:19:59 +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 , Shuah Khan , stable@vger.kernel.org Subject: [PATCH v3 2/4] scripts/kernel-doc: avoid error_count overflows Date: Tue, 13 Jan 2026 18:19:54 +0100 Message-ID: <80bd110988b8c1bd1118250c2acc05e9d2241709.1768324572.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 Cc: stable@vger.kernel.org --- 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 Sun Feb 8 05:27:42 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 2DF5D32B98F; Tue, 13 Jan 2026 17:20:02 +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=1768324802; cv=none; b=JnZ/XbNUc+5ppE4BHAsdftgV5/nImErfmn2ANz0xaperiklueOfjVSqTJawRbHiSlPv5bZ/7AkrUxMXUOig4D0oCiFXdY9AJH12SftzlC6m8FD2H240DG2KwTXBMpEUQ4vX1WAc/Jth4iWsKoR0WOynWc6rXnW6zGL9IOSUj3Aw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768324802; c=relaxed/simple; bh=2m6TV9TmCb8dmWC8RNmdbds1yQ7T9JqcpLqXcM2+DNA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BikPkYyfKRC29yuO8395FNdp1ntZ/XwOlRhxXUP7fzbTMxCz101D396xH5i+S0XzXJ+10r+mKF+B09BdJvevuXy+cyZ9CMovVIBbXpjEwX6d5i+UjC8ofGyCrmquY4S+VGy457pqa3lilN/+zPwpLSoh9LNyMwAMUqkO4xINR4w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YpUAVV07; 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="YpUAVV07" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8223C4AF0C; Tue, 13 Jan 2026 17:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768324801; bh=2m6TV9TmCb8dmWC8RNmdbds1yQ7T9JqcpLqXcM2+DNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YpUAVV078V6+5O6pPjAW4daEBUuna0/7o0qBfhQtnBwPEylvFjqT4S4rKg0L1zTPd r5JGwGZ7Is3Is6umlwV6523mfqet8niK84IuPxeqLOAQikYAYBKpQ01q3+Dy9TpHHt FC6fS7he8Oyqli2I1SJiv/Oh0RLCKlcqpDEfttQfepmBum3jEtj2bXs31rWyNYp6/v UXEtn3uDOloI/qe/IXy5KWlppWWdMPdElaMfphkX1uxPz7Ar74dXiQG8qJ2UDDS1T/ h8Q6ZtHYUBlNI94vL2u5ZKApIw/vyAD8v6I2X/4HYs54cN4MHfW+RjYXe2hIHjmfb+ dxIs6ZfeS7G1A== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfi3j-00000000zeG-3WOy; Tue, 13 Jan 2026 18:19:59 +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 , Shuah Khan Subject: [PATCH v3 3/4] scripts/kernel-doc: ensure that comments are using our coding style Date: Tue, 13 Jan 2026 18:19:55 +0100 Message-ID: <55357e0465e1a73c64f875f4b45c6d443b33ab38.1768324572.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 | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index 5d2f29e90ebe..da06184cbd8b 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -3,7 +3,7 @@ # Copyright(c) 2025: Mauro Carvalho Chehab . # # pylint: disable=3DC0103,R0912,R0914,R0915 - +# # NOTE: While kernel-doc requires at least version 3.6 to run, the # command line should work with Python 3.2+ (tested with 3.4). # The rationale is that it shall fail gracefully during Kernel @@ -12,7 +12,7 @@ # - no f-strings can be used on this file. # - the libraries that require newer versions can only be included # after Python version is checked. - +# # Converted from the kernel-doc script originally written in Perl # under GPLv2, copyrighted since 1998 by the following authors: # @@ -197,8 +197,9 @@ def main(): parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawTextH= elpFormatter, description=3DDESC) =20 + # # Normal arguments - + # parser.add_argument("-v", "-verbose", "--verbose", action=3D"store_tru= e", help=3D"Verbose output, more warnings and other in= formation.") =20 @@ -213,8 +214,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 - + # parser.add_argument("-Wreturn", "--wreturn", action=3D"store_true", help=3D"Warns about the lack of a return markup on= functions.") =20 @@ -235,8 +237,9 @@ def main(): parser.add_argument("-export-file", "--export-file", action=3D'append', help=3DEXPORT_FILE_DESC) =20 + # # Output format mutually-exclusive group - + # out_group =3D parser.add_argument_group("Output format selection (mutu= ally exclusive)") =20 out_fmt =3D out_group.add_mutually_exclusive_group() @@ -248,8 +251,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 - + # sel_group =3D parser.add_argument_group("Output selection (mutually ex= clusive)") sel_mut =3D sel_group.add_mutually_exclusive_group() =20 @@ -262,7 +266,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 +301,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 +315,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 +356,8 @@ def main(): =20 sys.exit(0) =20 +# # Call main method +# if __name__ =3D=3D "__main__": main() --=20 2.52.0 From nobody Sun Feb 8 05:27:42 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 2DFCE34E74F; Tue, 13 Jan 2026 17:20:02 +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=1768324802; cv=none; b=Oz27J7TPlCirAwXk3gGA5bSm+/UrlF8/O7guF5yG36Rt0HlALv+wUw6twiN1h7Bv6z9Z9lK6Q8MZ957S/fRGusmZwm81ZRxMRmdMa0Y64L8jv3qAqmZrUQhtGyuCJrwSOYzrSRcYQl1HwLz4VfEnKebHcxgt5fbfSsh8bgVdv2c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768324802; c=relaxed/simple; bh=foDF5kyQKVn5m0aZgBgzovxLoUT+5gGYYs+E7zG6moo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FZexYwE5CeChLg15DH7V4TCclYkdv7tjWgWZzIPPFUJrb09Cdh/pMuioNk/xf3uSNlP7KEZFKmCN71wds12F6WlovcuWuEu6KQCdkoOTcaTzE5bs8JhqgpGgYfHvm/+dzQRfaeBBHn8MRBvfy8lwfapY27Ztf20mJFXko/ZNROk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fvic6u1O; 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="fvic6u1O" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BFA44C19424; Tue, 13 Jan 2026 17:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768324801; bh=foDF5kyQKVn5m0aZgBgzovxLoUT+5gGYYs+E7zG6moo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fvic6u1OgU037oeHc/12bn7Y9ejQv7En2yCgdE74A+Q8bexSBY3ZwkPhsmGwDikcA liLnVZIbi8pMRE9azYO6Ext8Qus0tLzBMHsjV4ZwbNiMJcG6YJnQkbU23i6gx70xH+ 8/UCN3HH/DLyICbgu4OOLhijUWRjuCq/UUeCZ9ou6wBIL9KHUghrIV2bho09UO6Vk2 sGWK9SKP6TR49j9hjyKkR2gRScAXgEVtDJkzG726WnZAWgtR7+Jcwjm5GQZNexuz64 XJeYPkx8dznCp6QAPl/Q+qoSKCkOe8bgTVKWYt30yrPeyfX3d+2qm2CRD/7yRpHCHb 958qk0tkXVWLQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vfi3j-00000000zeK-3dJ5; Tue, 13 Jan 2026 18:19:59 +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 , Shuah Khan Subject: [PATCH v3 4/4] scripts/kernel-doc: some fixes to kernel-doc comments Date: Tue, 13 Jan 2026 18:19:56 +0100 Message-ID: <434e60e7868ef4e001e81e8cfa872dec711ddd34.1768324572.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 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index da06184cbd8b..4998a79ea6d1 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -9,9 +9,9 @@ # 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() @@ -273,7 +273,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) @@ -302,12 +302,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.= ") @@ -316,7 +316,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