From nobody Sat Feb 7 11:52:37 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 D2A24222575; Tue, 27 Jan 2026 08:03:42 +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=1769501022; cv=none; b=noqHtEdI541H6yho+WvKaZqdvRrK3xBb3041pyHBJjLN1+G8AMjLiEH23YOynqinH6vfO9E6FT8YeVfebnUB9h1udIGcoMCHQiK0dPpqhSEQnBCT0XpD0dD64rxRAN3r+OjccQtoFobPOJTEtpY9eg+JWtema9C0j4e+gS5hBfg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769501022; c=relaxed/simple; bh=VIlaRMwPjIfEIQDuYa02KnJ1UgKS/LPF/904EgFNK3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tzNmVy83adaPE+YKWRa2dTtaVX52MBOCFMIrr2mmu4rZezzOBD0fK9DS86A4T7E5dwtrtKcfNV8rQzLZowaNdiDiXP0l5FbpjL8qhDiFHIpUeUtVxwFTyO14abKB+6m/B8YHS+R0OlhTOi1SoXyjc9j8iU5BTVAzqkibZY1ABk8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IOzTe4DK; 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="IOzTe4DK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B3B4C19425; Tue, 27 Jan 2026 08:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769501022; bh=VIlaRMwPjIfEIQDuYa02KnJ1UgKS/LPF/904EgFNK3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IOzTe4DK7GJoZlIpdG2Vsjos6l5etoJMO29ZVqZStL8KjvH4aJ3xTXiLN+exD1Kvu ogQ3JmFUwVChz7IP12B/KDA1c0up5dAqErfccmtpKrzYGl++LS9Ev/HW0+PEkGOV1z 1GfCgbpeOndtc7fxwQQTpA9LeadoKqxWl/Lab99bk1Jemwsp+AmjAqkjEieTx1lrC6 nWV46R+dzCycW6jUW4rZXIOI8RBKbq1aKFR7emSEAOFbfYtQQIbx67JQk3sOMnC97A lJNttgMpaP9kbGpCw0oJIN3yi0LeCbBv/fyDPuB+3QruvOyUzvd/gE706buqoNBgSb osIYWXl2O0D6A== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vke32-0000000BNM8-2CYA; Tue, 27 Jan 2026 09:03:40 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Akira Yokosawa , Jani Nikula , Jonathan Corbet , Mauro Carvalho Chehab , Randy Dunlap Subject: [PATCH 1/3] docs: kdoc: Fix pdfdocs build for tools Date: Tue, 27 Jan 2026 09:03:32 +0100 Message-ID: <2fff8ef1d0d64e8b68f15f5c07613f302d773855.1769500383.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 "\1" inside a docstring requires proper scaping to not be considered a hex character and break the build. Reported-by: Akira Yokosawa Closes: https://lore.kernel.org/linux-doc/63e99049-cc72-4156-83af-414fdde34= 312@gmail.com/ Signed-off-by: Mauro Carvalho Chehab --- tools/lib/python/kdoc/kdoc_re.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_re.py b/tools/lib/python/kdoc/kdoc_= re.py index 2816bd9f90f8..0bf9e01cdc57 100644 --- a/tools/lib/python/kdoc/kdoc_re.py +++ b/tools/lib/python/kdoc/kdoc_re.py @@ -228,14 +228,18 @@ class NestedMatch: yield line[t[0]:t[2]] =20 def sub(self, regex, sub, line, count=3D0): - """ + r""" This is similar to re.sub: =20 It matches a regex that it is followed by a delimiter, replacing occurrences only if all delimiters are paired. =20 - if r'\1' is used, it works just like re: it places there the - matched paired data with the delimiter stripped. + if the sub argument contains:: + + r'\1' + + it will work just like re: it places there the matched paired data + with the delimiter stripped. =20 If count is different than zero, it will replace at most count items. --=20 2.52.0 From nobody Sat Feb 7 11:52:37 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 D2AE1225775; Tue, 27 Jan 2026 08:03:42 +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=1769501022; cv=none; b=gjX9oHCr3P48/Cp9MWYNQv7SVqUqB0iO8SD08UEugpXwiHBfTGKe+XPiFl4pY1A3pT6fhBZ1iqFQJmJAUGgSfYddFP9mdSpsnw4TEYgDfHRDHyWzW9OB84JZX5XeFKNUGo9/qULxCg78P3HrA+TG5Z2pTj2Wtch0fFJer6D/xzk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769501022; c=relaxed/simple; bh=4aMfKYcVERhHxWAsYjEi8+tgICvrID1mZsAmSUTyoxc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qSL09zp8nE249UHgFx7+s52jBXoTRxTb19YoREJ3ki1vTnujSTAyY3TlFYoUcIZPnouEsqjl93Wl34TrTUD3uzcBNFxQf/0OFUJmrYaHWpaB82xK/P7grujgjGQl6T6FCYnUJLJXAPP/V+haVfR2DRCYsj2qIrxdOxzdLorSWU0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=e8PHfVcH; 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="e8PHfVcH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87E80C116C6; Tue, 27 Jan 2026 08:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769501022; bh=4aMfKYcVERhHxWAsYjEi8+tgICvrID1mZsAmSUTyoxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=e8PHfVcH/mZAFCMK5DqBk883olLDCPcr17h91d3uQKrA2u6ubr+MdvIehBPVLgM8I mfXJut+OaXnmfyJ9IzWu7hox3WfPZHBZ17A6z8EePcMbKkQMMNgb+DaVzSBo/BkKTn E4QonkU2WX1g7zPu9LuRbYkUTUujHWTuw12ykSmIyC1cO9G0oL+w2b43ruWFi2QZJt Z/xLRMHnMnxieQ8qmbL6AS+8rqNSZ4OUs0Mx2xZHL1BvCKfcyWgByMiCgH/dPM36dN rrn9XmIcKcpsCs9KDImkNUn6iEViehR7pRrh2CJyp8gRyRFS5BED50JBLeRlnQ1SCn rRQTZHbKD7W4A== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vke32-0000000BNMC-2JjR; Tue, 27 Jan 2026 09:03:40 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Akira Yokosawa , Jani Nikula , Jonathan Corbet , Shuah Khan Subject: [PATCH 2/3] docs: sphinx-build-wrapper: allow -v override -q Date: Tue, 27 Jan 2026 09:03:33 +0100 Message-ID: <38b24e97a3cbd2def418359a8e69b1b087a945ad.1769500383.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 Documentation builds were using "-q" for a long time, but sometimes it is nice to see the Sphinx progress, without increasing build verbosity - which would also turn on kernel-doc verbosity. Instead of doing that, let's parse the sphinx-build already-existing -v: each time it is used, it increases the verbosity level. With that, if the default is to use -q, a single -v will disable quiet mode. Passing more -v will keep increasing its verbosity. Signed-off-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 78ff7ac202ef..8080ace60680 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -168,6 +168,7 @@ class SphinxBuilder: parser =3D argparse.ArgumentParser() parser.add_argument('-j', '--jobs', type=3Dint) parser.add_argument('-q', '--quiet', action=3D'store_true') + parser.add_argument('-v', '--verbose', default=3D0, action=3D'coun= t') =20 # # Other sphinx-build arguments go as-is, so place them @@ -179,10 +180,14 @@ class SphinxBuilder: # Build a list of sphinx args, honoring verbosity here if specified # =20 - verbose =3D self.verbose sphinx_args, self.sphinxopts =3D parser.parse_known_args(sphinxopt= s) + + verbose =3D sphinx_args.verbose + if self.verbose: + verbose +=3D 1 + if sphinx_args.quiet is True: - verbose =3D False + verbose =3D 0 =20 # # If the user explicitly sets "-j" at command line, use it. @@ -195,8 +200,11 @@ class SphinxBuilder: else: self.n_jobs =3D None =20 - if not verbose: + if verbose < 1: self.sphinxopts +=3D ["-q"] + else: + for i in range(1, sphinx_args.verbose): + self.sphinxopts +=3D ["-v"] =20 def __init__(self, builddir, venv=3DNone, verbose=3DFalse, n_jobs=3DNo= ne, interactive=3DNone): --=20 2.52.0 From nobody Sat Feb 7 11:52:37 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 D2A822236E0; Tue, 27 Jan 2026 08:03:42 +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=1769501022; cv=none; b=r5npWPEiwlU87jFnX/TUDNy+tnlTzoGoYWcj/USuznwzq1wnTQDTdzF+qzT8JjYcZHrnRMk9UOS69rokw+8UjZ/esCAp6HKWsra8t/e3ICFmb1QneZ9d1xyl6+tTdSuQgsUKCRA1OA5RohRI85xk6Pk7Xp8dJT9m6h6zS818Ko8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769501022; c=relaxed/simple; bh=C2cStPoOoGCftK6fYM/VQjKEO1UC2wtJ9483nmjaklU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pOVcYER9lEHbEe5ghdl8BsTOcIpVOkmVCLunLCb9adkakyYgq6UsOonwMlsKVcxLGUOvKZ3oXZwb0pU+RScw/mR0dEXTp/OsjygrHoanhbajCBWjewQQIfTuB4QqynqzvFdfX+Z/lB2+2X9fgenMKAdHoRlKTjcvO8ic9ykm58w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ff2d5tvP; 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="ff2d5tvP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EEE1C2BC86; Tue, 27 Jan 2026 08:03:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1769501022; bh=C2cStPoOoGCftK6fYM/VQjKEO1UC2wtJ9483nmjaklU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ff2d5tvPIUy7sYereZn22wwUrmunMAY8+6pclEQDTx7pMtmbEGdDmF9yoxDK1dnx2 xyL0VFLR8+c9xq4vo9RBRuGMYtZDbZvp7uBQEX9JahvtNjZDoabpbBX6D65SQKODft et2VW2sFnssDRglBJXZjg2uXu61H12gnbXkmBQ2qmkucpihgU94PwHoT8JbjntBliv pOnRzwRbxM9lyDjXeTirvYqXxIbfvJfMCeeap+7zk9GuhJf0ombpOmHbd4XEU3C4vq ifMT+eMX1AJ7RCiabmB8lKyIY3fKHkkPzSAt22EfoIGPb/5YfoOdEK7LVGbkQAVcRo /CD8IAG+85Czg== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vke32-0000000BNMG-2QwZ; Tue, 27 Jan 2026 09:03:40 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Akira Yokosawa , Jani Nikula , Mauro Carvalho Chehab , Shuah Khan Subject: [PATCH 3/3] tools: sphinx-build-wrapper: improve its help message Date: Tue, 27 Jan 2026 09:03:34 +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 Besides the parameters that are passed via command line arguments, the wrapper's behavior is affected by several environment variables. Document that. While here, use __doc__ for its description. Signed-off-by: Mauro Carvalho Chehab --- tools/docs/sphinx-build-wrapper | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tools/docs/sphinx-build-wrapper b/tools/docs/sphinx-build-wrap= per index 8080ace60680..b7c149dff06b 100755 --- a/tools/docs/sphinx-build-wrapper +++ b/tools/docs/sphinx-build-wrapper @@ -814,20 +814,42 @@ def jobs_type(value): except ValueError: raise argparse.ArgumentTypeError(f"Must be 'auto' or positive inte= ger, got {value}") # pylint: disable=3DW0707 =20 +EPILOG=3D""" +Besides the command line arguments, several environment variables affect i= ts +default behavior, meant to be used when called via Kernel Makefile: + +- KERNELVERSION: Kernel major version +- KERNELRELEASE: Kernel release +- KBUILD_VERBOSE: Contains the value of "make V=3D[0|1] variable. + When V=3D0 (KBUILD_VERBOSE=3D0), sets verbose level to "= -q". +- SPHINXBUILD: Documentation build tool (default: "sphinx-build"). +- SPHINXOPTS: Extra options pased to SPHINXBUILD + (default: "-j auto" and "-q" if KBUILD_VERBOSE=3D0). + The "-v" flag can be used to increase verbosity. + If V=3D0, the first "-v" will drop "-q". +- PYTHON3: Python command to run SPHINXBUILD +- PDFLATEX: LaTeX PDF engine. (default: "xelatex") +- LATEXOPTS: Optional set of command line arguments to the LaTeX engi= ne +- srctree: Location of the Kernel root directory (default: "."). + +""" + def main(): """ Main function. The only mandatory argument is the target. If not specified, the other arguments will use default values if not specified at os.environ. """ - parser =3D argparse.ArgumentParser(description=3D"Kernel documentation= builder") + parser =3D argparse.ArgumentParser(formatter_class=3Dargparse.RawTextH= elpFormatter, + description=3D__doc__, + epilog=3DEPILOG) =20 parser.add_argument("target", choices=3Dlist(TARGETS.keys()), help=3D"Documentation target to build") parser.add_argument("--sphinxdirs", nargs=3D"+", help=3D"Specific directories to build") parser.add_argument("--builddir", default=3D"output", - help=3D"Sphinx configuration file") + help=3D"Sphinx configuration file (default: %(defa= ult)s)") =20 parser.add_argument("--theme", help=3D"Sphinx theme to use") =20 @@ -843,7 +865,7 @@ def main(): help=3D"place build in verbose mode") =20 parser.add_argument('-j', '--jobs', type=3Djobs_type, - help=3D"Sets number of jobs to use with sphinx-bui= ld") + help=3D"Sets number of jobs to use with sphinx-bui= ld(default: auto)") =20 parser.add_argument('-i', '--interactive', action=3D'store_true', help=3D"Change latex default to run in interactive= mode") --=20 2.52.0