From nobody Sun Feb 8 19:59:39 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 EF6A23321AA; Sat, 17 Jan 2026 09:29:32 +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=1768642173; cv=none; b=NPjWZchizJhYhJObnsK/xqOLL4mnS8Lrc4bM4MgKKmr2PA/9akMCxisXFi1aAJ9W+j2CuHJ4vzbDOpCTXXsuLO3zFSYnych4jmt51T4mEw2hrelmo8I6fyx99ET9H54mz+RXm8HDnVDN3SJ630aVD3YAWCK/PbXzqaLVKV340oA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768642173; c=relaxed/simple; bh=uAgz6NVwdL1fSgq++5Vdt7SvGll1o/f20D2+Kc+Gl6c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type:Content-Type; b=hbFrGCfRbzR6RqB2nLBAjoSgbsMEgx5ttjsOSYUPTvDxXW0lG2JnrTq0Ndej4FDWpTjKrBH35lS8bHwUAk+oyWHfRk5CWTkB2aI0dFlSiKiBGkkA0tcIrsJLBUGPErAH5TTRAfMtw6FQrGwQegChlZud0Yhx/umJ3LqiAEL5DSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sybllAQf; 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="sybllAQf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CAB7C4AF0B; Sat, 17 Jan 2026 09:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1768642172; bh=uAgz6NVwdL1fSgq++5Vdt7SvGll1o/f20D2+Kc+Gl6c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sybllAQfk6XLJ1XUAsuB9WmR9aPN8p7tdcX1PXFujVQ7j3SugGU7HH7XvtbnxCxTy ZDTpgJRHm/5kozVm5TnDdgjg4wxy8ao79v5930/gExoq4nd4+qfeD3NP1Ek/Vv21I7 HgV54NfeLoX5zyyqDz6gfGWFjqwFCm4JAqCiG8CDZmWxxI16YXivyyZrJ8tiVRXIzY 6jGTv/HH0hdN7Lu7KM+Vv8lUdmxYxg9cwh0giv2bbSntX/sWevUM2X/Hi/AFXhJM44 Fu5s83789MkFSkTIv+5jt9VBOiC5LEE/aRmNN2i1KQb7/vsK3meNuKPx8JjFXGDjM0 VGOg7oiXHRBcA== Received: from mchehab by mail.kernel.org with local (Exim 4.99) (envelope-from ) id 1vh2cc-00000000foA-0dJC; Sat, 17 Jan 2026 10:29:30 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Jonathan Corbet , Shuah Khan Subject: [PATCH v5 4/4] scripts/kernel-doc: some fixes to kernel-doc comments Date: Sat, 17 Jan 2026 10:29:26 +0100 Message-ID: <80e96e47af63a46d9a082785bf1bde35f73540d7.1768642102.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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab There are some typos and English errors in the comments of kernel=E2=80=91d= oc.py. Locate them with the help of an LLM (gpt=E2=80=91oss 14B), executed locally with this prompt: review English grammar and syntax at the comments on the code below: While LLM worked fine for the task of doing an English grammar review for strings, being able to distinguish them from the actual code, it was not is perfect: some things required manual work to fix. - While here, replace: "/**" with: ``/**`` As, if we ever rename this script to kernel_doc.py and add it to Sphinx ext autodoc, we want to avoid this warning: scripts/kernel_doc.py:docstring of kernel_doc:10: WARNING: Inline stron= g start-string without end-string. [docutils] Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index f1f3f56edeb5..4e3b9cfe3fd7 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: @@ -88,16 +88,13 @@ # Yujie Liu =20 """ -kernel_doc -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -Print formatted kernel documentation to stdout +Print formatted kernel documentation to stdout. =20 Read C language source or header FILEs, extract embedded documentation comments, and print formatted documentation to standard output. =20 -The documentation comments are identified by the "/**" +The documentation comments are identified by the ``/**`` opening comment mark. =20 See Documentation/doc-guide/kernel-doc.rst for the @@ -134,13 +131,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 +160,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 +168,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 +270,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 +299,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 +313,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