From nobody Sun Feb 8 23:41:55 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 8EFCA2475C7; Mon, 24 Feb 2025 09:09:03 +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=1740388143; cv=none; b=FXlvfxN3uMkSSFKDu0WxqRxlSNyzETNZ7YI9HRafT93/b9U6XpDTDGLU5ZXVBrQF6CGJRgL3ZEIgD5qinPyIvGFEhvZ+cByyr6ZlIOMlsnGoXAXBNsluRs0RdooLyfCdM1XqrCy3PTuw26/Cpacz40lf9e9wVq5r0hd1yqjTPfU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740388143; c=relaxed/simple; bh=IpThprTfJ/pbtHwAeyiILQ0MdhJxWk9SeTU5TEeUoNg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nc2UDfUjdJjqew/QZcF349bPHo+BIdQqzfd+hTPdP0Dewca04+FyAQz9c19fWfRnch7AQr8yIevUsXLk47auVyXg3qLel03qeeXkzv6g1L23tOzjsA/vkgw0VgXn/s+5NhaRlBU+ZgWADkZiFRZuD8ho9DhX8zYhedwVX1igJuw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IsrVLo0G; 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="IsrVLo0G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BD52C116C6; Mon, 24 Feb 2025 09:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740388143; bh=IpThprTfJ/pbtHwAeyiILQ0MdhJxWk9SeTU5TEeUoNg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsrVLo0G7Rglf1TxWKWKtqL8JAhipBdKRAcqPlq1E9nn4d8A6eYulJjQRBPVngDak ly4Xh15mZ5Yj0IJPpPvN5oiv0B5LSrfN2VF7J0ITYlSTyYICP3JyaS1XT9ef5IAdyJ 1QGRcp+2yEkw0PUEb8bg5C4jNp/9M2h81LNlY0bAKJlN9P3JrfvlJ8rExuAoAYbvGX 1L1wScwAV4MS2u0rMcS9o5oNts/aroPlQihN2yPpuDrbRLiDJG8ompRSNFEHHrRTza jm2dg1s+xaSjtphN8M3pCAFCBVO8FxbW3eHJ8ranRYcuygLgYYG7tcdAUfwXo7ARJv BzMUZHVsDXY5A== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tmUST-00000003p4e-1JGU; Mon, 24 Feb 2025 10:09:01 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [PATCH v2 19/39] scripts/kernel-doc.py: implement support for -no-doc-sections Date: Mon, 24 Feb 2025 10:08:25 +0100 Message-ID: <5292a5419c95f7754706e4d7ee59f74bf8d876b5.1740387599.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.48.1 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-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" The venerable kernel-doc Perl script has a number of options that aren't properly documented. Among them, there is -no-doc-sections, which is used by the Sphinx extension. Implement support for it. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc.py | 8 ++++++-- scripts/lib/kdoc/kdoc_files.py | 5 +++-- scripts/lib/kdoc/kdoc_output.py | 7 ++++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py index a687a7abb3b9..d700451e9541 100755 --- a/scripts/kernel-doc.py +++ b/scripts/kernel-doc.py @@ -164,10 +164,13 @@ def main(): sel_mut.add_argument("-s", "-function", "--symbol", action=3D'append', help=3DFUNCTION_DESC) =20 - # This one is valid for all 3 types of filter + # Those are valid for all 3 types of filter parser.add_argument("-n", "-nosymbol", "--nosymbol", action=3D'append', 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") + parser.add_argument("files", metavar=3D"FILE", nargs=3D"+", help=3DFILES_DESC) =20 @@ -209,7 +212,8 @@ def main(): =20 for t in kfiles.msg(enable_lineno=3Dargs.enable_lineno, export=3Dargs.= export, internal=3Dargs.internal, symbol=3Dargs.symbol, - nosymbol=3Dargs.nosymbol): + nosymbol=3Dargs.nosymbol, + no_doc_sections=3Dargs.no_doc_sections): msg =3D t[1] if msg: print(msg) diff --git a/scripts/lib/kdoc/kdoc_files.py b/scripts/lib/kdoc/kdoc_files.py index 4a6e75dbdbdd..c215ae3047b8 100755 --- a/scripts/lib/kdoc/kdoc_files.py +++ b/scripts/lib/kdoc/kdoc_files.py @@ -237,7 +237,7 @@ class KernelFiles(): return self.out_style.msg(fname, name, arg) =20 def msg(self, enable_lineno=3DFalse, export=3DFalse, internal=3DFalse, - symbol=3DNone, nosymbol=3DNone): + symbol=3DNone, nosymbol=3DNone, no_doc_sections=3DFalse): """ Interacts over the kernel-doc results and output messages, returning kernel-doc markups on each interaction @@ -256,7 +256,8 @@ class KernelFiles(): self.out_style.set_config(self.config) =20 self.out_style.set_filter(export, internal, symbol, nosymbol, - function_table, enable_lineno) + function_table, enable_lineno, + no_doc_sections) =20 for fname, arg_tuple in self.results: msg =3D "" diff --git a/scripts/lib/kdoc/kdoc_output.py b/scripts/lib/kdoc/kdoc_output= .py index 91f6e356d03d..8729dc58e13c 100755 --- a/scripts/lib/kdoc/kdoc_output.py +++ b/scripts/lib/kdoc/kdoc_output.py @@ -69,6 +69,7 @@ class OutputFormat: self.symbol =3D None self.function_table =3D set() self.config =3D None + self.no_doc_sections =3D False =20 self.data =3D "" =20 @@ -76,7 +77,7 @@ class OutputFormat: self.config =3D config =20 def set_filter(self, export, internal, symbol, nosymbol, function_tabl= e, - enable_lineno): + enable_lineno, no_doc_sections): """ Initialize filter variables according with the requested mode. =20 @@ -86,6 +87,7 @@ class OutputFormat: """ =20 self.enable_lineno =3D enable_lineno + self.no_doc_sections =3D no_doc_sections =20 if symbol: self.out_mode =3D self.OUTPUT_INCLUDE @@ -116,6 +118,9 @@ class OutputFormat: def check_doc(self, name): """Check if DOC should be output""" =20 + if self.no_doc_sections: + return False + if self.out_mode =3D=3D self.OUTPUT_ALL: return True =20 --=20 2.48.1