From nobody Thu Apr 9 15:01:00 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 C9CD0421EF2; Mon, 2 Mar 2026 16:41:09 +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=1772469669; cv=none; b=lh2/GrQkZcC6cLxnFS/FIKIt3/Kk4FHIfFWfwbOfBP+3+Z93aESmmJagPLmDigkJ5rg0fjLtyUc5tZTxF7pvlKVskNJzrJZRIR3rR7bemdCdNkfOnhd4raHs56bs3WVzCzpq27ZVXOSO5663KgUJpb9fMcBH//IgUoRaPgcsc4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772469669; c=relaxed/simple; bh=ftCwoMytpLULQWEXGblskf53KEc3VuT0xZwVGahX9Ic=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YjHxgcTDXMDhO5lG2gevDPUItTTZw2k+lYrRgv5GDOE35jjwhdd29144YsUF6+MBjbmTPAp1SjJvbsZp5p7TaTHun1U+UAuVLUmSKNhtuS2llLbd7UEMm9O1Fdkt0BiLOlcEFeQFh3qqv2KSwbed4KMcdQAUCbLTN63DEePD9Bc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KbkcXPGa; 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="KbkcXPGa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84C30C2BC9E; Mon, 2 Mar 2026 16:41:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772469669; bh=ftCwoMytpLULQWEXGblskf53KEc3VuT0xZwVGahX9Ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KbkcXPGa8XpCHMjRifGVHpDVmovqOP+blOxiAJt5bjwZzr71L/nyCqg3AelK+AQPl /jVIP27whgnKKVGttZDpkoJQmf+J00s3/GHpBD6dX1BTW2Eh/bLexD1oA2RSV08Nhl btg1W2+VDzfB8KyRpWNmQRO0SE18ytwMW+wF7NF9cLSNTkC1jHsRK5ib8MJE+5/Bem S6JFmqyDhVC2lLX4M7rJ5BaTj1gbwxYeHxBTr1n1lBkDOLTNFwONSWmxnMnf+8JK+l flJ33S9k8iOwjMguVgy6eUIvKW30Qlg9T83pl0HQo6KtpoYh/vDVQ0iqpCZ7r6UG6L aC2iEBBS9iYYw== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vx6KR-000000002zS-18sg; Mon, 02 Mar 2026 17:41:07 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksandr Loktionov , Randy Dunlap Subject: [PATCH 03/18] docs: kdoc_parser: move var transformers to the beginning Date: Mon, 2 Mar 2026 17:40:46 +0100 Message-ID: <491b290252a308f381f88353a3bbe9e2bd1f6a62.1772469446.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 Just like functions and structs had their transform variables placed at the beginning, move variable transforms to there as well. No functional changes. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap Reviewed-by: Aleksandr Loktionov --- tools/lib/python/kdoc/kdoc_parser.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index ca00695b47b3..68a5aea9175d 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -192,6 +192,18 @@ function_xforms =3D [ (KernRe(r"__attribute__\s*\(\((?:[\w\s]+(?:\([^)]*\))?\s*,?)+\)\)\s+")= , ""), ] =20 +# +# Transforms for variable prototypes +# +var_xforms =3D [ + (KernRe(r"__read_mostly"), ""), + (KernRe(r"__ro_after_init"), ""), + (KernRe(r"(?://.*)$"), ""), + (KernRe(r"(?:/\*.*\*/)"), ""), + (KernRe(r";$"), ""), + (KernRe(r"=3D.*"), ""), +] + # # Ancillary functions # @@ -972,15 +984,6 @@ class KernelDoc: ] OPTIONAL_VAR_ATTR =3D "^(?:" + "|".join(VAR_ATTRIBS) + ")?" =20 - sub_prefixes =3D [ - (KernRe(r"__read_mostly"), ""), - (KernRe(r"__ro_after_init"), ""), - (KernRe(r"(?://.*)$"), ""), - (KernRe(r"(?:/\*.*\*/)"), ""), - (KernRe(r";$"), ""), - (KernRe(r"=3D.*"), ""), - ] - # # Store the full prototype before modifying it # @@ -1004,7 +1007,7 @@ class KernelDoc: # Drop comments and macros to have a pure C prototype # if not declaration_name: - for r, sub in sub_prefixes: + for r, sub in var_xforms: proto =3D r.sub(sub, proto) =20 proto =3D proto.rstrip() --=20 2.52.0