{"id":2197672,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2197672/?format=json","project":{"id":46,"url":"http://patchwork.ozlabs.org/api/1.0/projects/46/?format=json","name":"Intel Wired Ethernet development","link_name":"intel-wired-lan","list_id":"intel-wired-lan.osuosl.org","list_email":"intel-wired-lan@osuosl.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<7c62d09dfbdfa1c9ff26817cdd3a291775fa9199.1771408406.git.mchehab+huawei@kernel.org>","date":"2026-02-18T10:12:54","name":"[24/38] docs: kdoc_parser: use the new CFunction class","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":false,"hash":"539828d5340ade4735d1533c2e4aab93a0e63818","submitter":{"id":78235,"url":"http://patchwork.ozlabs.org/api/1.0/people/78235/?format=json","name":"Mauro Carvalho Chehab","email":"mchehab+huawei@kernel.org"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/intel-wired-lan/patch/7c62d09dfbdfa1c9ff26817cdd3a291775fa9199.1771408406.git.mchehab+huawei@kernel.org/mbox/","series":[{"id":492532,"url":"http://patchwork.ozlabs.org/api/1.0/series/492532/?format=json","date":"2026-02-18T10:12:30","name":"docs: several improvements to kernel-doc","version":1,"mbox":"http://patchwork.ozlabs.org/series/492532/mbox/"}],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2197672/checks/","tags":{},"headers":{"Return-Path":"<intel-wired-lan-bounces@osuosl.org>","X-Original-To":["incoming@patchwork.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Delivered-To":["patchwork-incoming@legolas.ozlabs.org","intel-wired-lan@lists.osuosl.org"],"Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=osuosl.org header.i=@osuosl.org header.a=rsa-sha256\n header.s=default header.b=VCud1Old;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fGC5h3dKGz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 21:13:44 +1100 (AEDT)","from localhost (localhost [127.0.0.1])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id A1037810BA;\n\tWed, 18 Feb 2026 10:13:38 +0000 (UTC)","from smtp1.osuosl.org ([127.0.0.1])\n by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 17c7enJLtcet; Wed, 18 Feb 2026 10:13:37 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp1.osuosl.org (Postfix) with ESMTP id C4092810A2;\n\tWed, 18 Feb 2026 10:13:37 +0000 (UTC)","from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133])\n by lists1.osuosl.org (Postfix) with ESMTP id AA47C206\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Feb 2026 10:13:29 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp2.osuosl.org (Postfix) with ESMTP id 9C39E4009A\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Feb 2026 10:13:29 +0000 (UTC)","from smtp2.osuosl.org ([127.0.0.1])\n by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id mOrELjGjZQux for <intel-wired-lan@lists.osuosl.org>;\n Wed, 18 Feb 2026 10:13:28 +0000 (UTC)","from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254])\n by smtp2.osuosl.org (Postfix) with ESMTPS id 9CC9640078\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Feb 2026 10:13:28 +0000 (UTC)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by tor.source.kernel.org (Postfix) with ESMTP id A503361863;\n Wed, 18 Feb 2026 10:13:27 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 59838C19421;\n Wed, 18 Feb 2026 10:13:27 +0000 (UTC)","from mchehab by mail.kernel.org with local (Exim 4.99.1)\n (envelope-from <mchehab+huawei@kernel.org>)\n id 1vseYf-00000000LnT-1nte; Wed, 18 Feb 2026 11:13:25 +0100"],"X-Virus-Scanned":["amavis at osuosl.org","amavis at osuosl.org"],"X-Comment":"SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=<UNKNOWN> ","DKIM-Filter":["OpenDKIM Filter v2.11.0 smtp1.osuosl.org C4092810A2","OpenDKIM Filter v2.11.0 smtp2.osuosl.org 9CC9640078"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1771409617;\n\tbh=sTUxCA2Izm1/CT/gnVWG0t+/bkV913E0yPfvllA4PXw=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=VCud1OldFWTV68Yl3ivf6eMyxslrDR1Z/JuugaRPoRcoooTPULjCAw6vut1OK04cm\n\t SrJ62eh3iWwl3tOVWHp60EVxfCiEdB9Eulq+A5EwH9RjqX6tdCqQ3+vbeFHrGkA8wi\n\t UDRb2cQDacqIvxj6jpLTX3fbk8ymN+Bn6CkZJFHhZb6XVROCWLC7H0eDljwliE8KDx\n\t cVcTicvce2h/qFyW1kAhFCrMemxbYhBqjsP8+nYdnqahVQmcOULZghE7UqdDACmL4b\n\t y07z2gGUXNK4issUx9retwLyflMBAjVyxwMdH8ERqM2GxCpQUPUKBTQcly0t8ppPde\n\t KIExlXb/496gw==","Received-SPF":"Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254;\n helo=tor.source.kernel.org; envelope-from=mchehab+huawei@kernel.org;\n receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp2.osuosl.org 9CC9640078","From":"Mauro Carvalho Chehab <mchehab+huawei@kernel.org>","To":"Jonathan Corbet <corbet@lwn.net>,\n Linux Doc Mailing List <linux-doc@vger.kernel.org>","Cc":"Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,\n intel-wired-lan@lists.osuosl.org, linux-hardening@vger.kernel.org,\n linux-kernel@vger.kernel.org, netdev@vger.kernel.org,\n Aleksandr Loktionov <aleksandr.loktionov@intel.com>,\n Randy Dunlap <rdunlap@infradead.org>","Date":"Wed, 18 Feb 2026 11:12:54 +0100","Message-ID":"\n <7c62d09dfbdfa1c9ff26817cdd3a291775fa9199.1771408406.git.mchehab+huawei@kernel.org>","X-Mailer":"git-send-email 2.52.0","In-Reply-To":"<cover.1771408406.git.mchehab+huawei@kernel.org>","References":"<cover.1771408406.git.mchehab+huawei@kernel.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"8bit","X-Mailman-Original-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple;\n d=kernel.org; s=k20201202; t=1771409607;\n bh=LSo+D03oZi5uYnZP1zzS1JgRumV9SCEqB+7zq9VZC18=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=fd3Y2AfSZCLVb5ho0UWRUs58DTPrrOkIU7PSANmR8ki1jLt2DsXQ2ROs4qWey8qkA\n J50SoWlEXy1c02lhZfVCQnSD8wdxJclhGd1SGwaZi2YAoS4/vGmi+qQp9sgg+/EwZC\n ZkVhNcSvjx2gh4MVquWOXQ0g1bmybFGBRklgB7c2XYzLfQaxh1z+0B8n/PLSoWgXbK\n 4wVBJBNy1Rr2jw+rNVPFdTCByZ6wyMv7tZLaNMP9+ThwXv1Ppz3BoRY90kHq1RyVA5\n fBhWlrLWbEnhUupj4ZE1juMVzNYwPg87WERnqEzAklV+uq0H2UdQC4d9AziGWxIAWa\n b2c4EWOzUHEEQ==","X-Mailman-Original-Authentication-Results":["smtp2.osuosl.org;\n dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","smtp2.osuosl.org;\n dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org\n header.a=rsa-sha256 header.s=k20201202 header.b=fd3Y2AfS"],"Subject":"[Intel-wired-lan] [PATCH 24/38] docs: kdoc_parser: use the new\n CFunction class","X-BeenThere":"intel-wired-lan@osuosl.org","X-Mailman-Version":"2.1.30","Precedence":"list","List-Id":"Intel Wired Ethernet Linux Kernel Driver Development\n <intel-wired-lan.osuosl.org>","List-Unsubscribe":"<https://lists.osuosl.org/mailman/options/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>","List-Archive":"<http://lists.osuosl.org/pipermail/intel-wired-lan/>","List-Post":"<mailto:intel-wired-lan@osuosl.org>","List-Help":"<mailto:intel-wired-lan-request@osuosl.org?subject=help>","List-Subscribe":"<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>,\n <mailto:intel-wired-lan-request@osuosl.org?subject=subscribe>","Errors-To":"intel-wired-lan-bounces@osuosl.org","Sender":"\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>"},"content":"The match logic for transforms becomes a lot clearer if we use\nCFunction convenient alias class instead of NestedMatch.\n\nSigned-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>\nReviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n---\n tools/lib/python/kdoc/kdoc_parser.py | 38 ++++++++++++++--------------\n 1 file changed, 19 insertions(+), 19 deletions(-)","diff":"diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py\nindex b63a70f184eb..e1914b2a6ab7 100644\n--- a/tools/lib/python/kdoc/kdoc_parser.py\n+++ b/tools/lib/python/kdoc/kdoc_parser.py\n@@ -13,7 +13,7 @@ import sys\n import re\n from pprint import pformat\n \n-from kdoc.kdoc_re import NestedMatch, KernRe\n+from kdoc.kdoc_re import CFunction, KernRe\n from kdoc.kdoc_item import KdocItem\n \n #\n@@ -119,22 +119,22 @@ struct_xforms = [\n     #\n     # As it doesn't properly match the end parenthesis on some cases.\n     #\n-    # So, a better solution was crafted: there's now a NestedMatch\n+    # So, a better solution was crafted: there's now a CFunction\n     # class that ensures that delimiters after a search are properly\n     # matched. So, the implementation to drop STRUCT_GROUP() will be\n     # handled in separate.\n     #\n-    (NestedMatch(r'\\bstruct_group\\s*\\('), r'\\2'),\n-    (NestedMatch(r'\\bstruct_group_attr\\s*\\('), r'\\3'),\n-    (NestedMatch(r'\\bstruct_group_tagged\\s*\\('), r'struct \\1 { \\3 } \\2;'),\n-    (NestedMatch(r'\\b__struct_group\\s*\\('), r'\\4'),\n+    (CFunction('struct_group'), r'\\2'),\n+    (CFunction('struct_group_attr'), r'\\3'),\n+    (CFunction('struct_group_tagged'), r'struct \\1 { \\3 } \\2;'),\n+    (CFunction('__struct_group'), r'\\4'),\n \n     #\n     # Replace macros\n     #\n-    # TODO: use NestedMatch for FOO($1, $2, ...) matches\n+    # TODO: use CFunction on all FOO($1, $2, ...) matches\n     #\n-    # it is better to also move those to the NestedMatch logic,\n+    # it is better to also move those to the CFunction logic,\n     # to ensure that parentheses will be properly matched.\n     #\n     (KernRe(r'__ETHTOOL_DECLARE_LINK_MODE_MASK\\s*\\(([^\\)]+)\\)', re.S),\n@@ -186,17 +186,17 @@ function_xforms = [\n     (KernRe(r\"DECL_BUCKET_PARAMS\\s*\\(\\s*(\\S+)\\s*,\\s*(\\S+)\\s*\\)\"), r\"\\1, \\2\"),\n     (KernRe(r\"__no_context_analysis\\s*\"), \"\"),\n     (KernRe(r\"__attribute_const__ +\"), \"\"),\n-    (NestedMatch(r\"__cond_acquires\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__cond_releases\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__acquires\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__releases\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__must_hold\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__must_not_hold\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__must_hold_shared\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__cond_acquires_shared\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__acquires_shared\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__releases_shared\\s*\\(\"), \"\"),\n-    (NestedMatch(r\"__attribute__\\s*\\(\"), \"\"),\n+    (CFunction(\"__cond_acquires\"), \"\"),\n+    (CFunction(\"__cond_releases\"), \"\"),\n+    (CFunction(\"__acquires\"), \"\"),\n+    (CFunction(\"__releases\"), \"\"),\n+    (CFunction(\"__must_hold\"), \"\"),\n+    (CFunction(\"__must_not_hold\"), \"\"),\n+    (CFunction(\"__must_hold_shared\"), \"\"),\n+    (CFunction(\"__cond_acquires_shared\"), \"\"),\n+    (CFunction(\"__acquires_shared\"), \"\"),\n+    (CFunction(\"__releases_shared\"), \"\"),\n+    (CFunction(\"__attribute__\"), \"\"),\n ]\n \n #\n","prefixes":["24/38"]}