From nobody Fri Apr 3 08:18:04 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 8EBEF34C81F; Wed, 18 Feb 2026 10:13:27 +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=1771409607; cv=none; b=mJv8jmGuRkIPF8hEIN50NkxTEuY/MHhXqNxCRXI7FfwNHdDK9t06FDkjQ538XOGVQsQeA9mcQwbjAR3g17BXih+zog9qGabPO9St0/xx2+DWGCwpi9H8slSpWYMkB9yiDzF/fRTaQjHM8Q2wOKOneO4XmkBK9TBwc+KQuIThPzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771409607; c=relaxed/simple; bh=LSo+D03oZi5uYnZP1zzS1JgRumV9SCEqB+7zq9VZC18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=L7+TUsF4OHNlaHOLpEjMBKiSxewELSTS58e4pFc3sWBgANDRvjp9zt422wl2PFHDAv7yZMhdinj6u5JPP5Yn1mQWaIWmtsQzlF86urJ4t2+gHBWIc04FZoBtjDVbcmHmXwOrYGIvRLrcW+XNTBo2+ktV0mz3essTjOHm//AB1Uk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fd3Y2AfS; 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="fd3Y2AfS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59838C19421; Wed, 18 Feb 2026 10:13:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771409607; bh=LSo+D03oZi5uYnZP1zzS1JgRumV9SCEqB+7zq9VZC18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fd3Y2AfSZCLVb5ho0UWRUs58DTPrrOkIU7PSANmR8ki1jLt2DsXQ2ROs4qWey8qkA J50SoWlEXy1c02lhZfVCQnSD8wdxJclhGd1SGwaZi2YAoS4/vGmi+qQp9sgg+/EwZC ZkVhNcSvjx2gh4MVquWOXQ0g1bmybFGBRklgB7c2XYzLfQaxh1z+0B8n/PLSoWgXbK 4wVBJBNy1Rr2jw+rNVPFdTCByZ6wyMv7tZLaNMP9+ThwXv1Ppz3BoRY90kHq1RyVA5 fBhWlrLWbEnhUupj4ZE1juMVzNYwPg87WERnqEzAklV+uq0H2UdQC4d9AziGWxIAWa b2c4EWOzUHEEQ== Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vseYf-00000000LnT-1nte; Wed, 18 Feb 2026 11:13:25 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , intel-wired-lan@lists.osuosl.org, linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Aleksandr Loktionov , Randy Dunlap Subject: [PATCH 24/38] docs: kdoc_parser: use the new CFunction class Date: Wed, 18 Feb 2026 11:12:54 +0100 Message-ID: <7c62d09dfbdfa1c9ff26817cdd3a291775fa9199.1771408406.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 match logic for transforms becomes a lot clearer if we use CFunction convenient alias class instead of NestedMatch. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Aleksandr Loktionov --- tools/lib/python/kdoc/kdoc_parser.py | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/k= doc_parser.py index b63a70f184eb..e1914b2a6ab7 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -13,7 +13,7 @@ import sys import re from pprint import pformat =20 -from kdoc.kdoc_re import NestedMatch, KernRe +from kdoc.kdoc_re import CFunction, KernRe from kdoc.kdoc_item import KdocItem =20 # @@ -119,22 +119,22 @@ struct_xforms =3D [ # # As it doesn't properly match the end parenthesis on some cases. # - # So, a better solution was crafted: there's now a NestedMatch + # So, a better solution was crafted: there's now a CFunction # class that ensures that delimiters after a search are properly # matched. So, the implementation to drop STRUCT_GROUP() will be # handled in separate. # - (NestedMatch(r'\bstruct_group\s*\('), r'\2'), - (NestedMatch(r'\bstruct_group_attr\s*\('), r'\3'), - (NestedMatch(r'\bstruct_group_tagged\s*\('), r'struct \1 { \3 } \2;'), - (NestedMatch(r'\b__struct_group\s*\('), r'\4'), + (CFunction('struct_group'), r'\2'), + (CFunction('struct_group_attr'), r'\3'), + (CFunction('struct_group_tagged'), r'struct \1 { \3 } \2;'), + (CFunction('__struct_group'), r'\4'), =20 # # Replace macros # - # TODO: use NestedMatch for FOO($1, $2, ...) matches + # TODO: use CFunction on all FOO($1, $2, ...) matches # - # it is better to also move those to the NestedMatch logic, + # it is better to also move those to the CFunction logic, # to ensure that parentheses will be properly matched. # (KernRe(r'__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)', re.S), @@ -186,17 +186,17 @@ function_xforms =3D [ (KernRe(r"DECL_BUCKET_PARAMS\s*\(\s*(\S+)\s*,\s*(\S+)\s*\)"), r"\1, \2= "), (KernRe(r"__no_context_analysis\s*"), ""), (KernRe(r"__attribute_const__ +"), ""), - (NestedMatch(r"__cond_acquires\s*\("), ""), - (NestedMatch(r"__cond_releases\s*\("), ""), - (NestedMatch(r"__acquires\s*\("), ""), - (NestedMatch(r"__releases\s*\("), ""), - (NestedMatch(r"__must_hold\s*\("), ""), - (NestedMatch(r"__must_not_hold\s*\("), ""), - (NestedMatch(r"__must_hold_shared\s*\("), ""), - (NestedMatch(r"__cond_acquires_shared\s*\("), ""), - (NestedMatch(r"__acquires_shared\s*\("), ""), - (NestedMatch(r"__releases_shared\s*\("), ""), - (NestedMatch(r"__attribute__\s*\("), ""), + (CFunction("__cond_acquires"), ""), + (CFunction("__cond_releases"), ""), + (CFunction("__acquires"), ""), + (CFunction("__releases"), ""), + (CFunction("__must_hold"), ""), + (CFunction("__must_not_hold"), ""), + (CFunction("__must_hold_shared"), ""), + (CFunction("__cond_acquires_shared"), ""), + (CFunction("__acquires_shared"), ""), + (CFunction("__releases_shared"), ""), + (CFunction("__attribute__"), ""), ] =20 # --=20 2.52.0