{"id":2197650,"url":"http://patchwork.ozlabs.org/api/1.0/patches/2197650/?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":"<87e79a43714d1de8258c169bf2a8e2ce30705df2.1771408406.git.mchehab+huawei@kernel.org>","date":"2026-02-18T10:12:34","name":"[04/38] docs: kdoc_parser: don't mangle with function defines","commit_ref":null,"pull_url":null,"state":"handled-elsewhere","archived":false,"hash":"7edc50b0836e5812ba4e71c4f1141e33598c97a0","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/87e79a43714d1de8258c169bf2a8e2ce30705df2.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/2197650/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=jK4S99zI;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=osuosl.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=intel-wired-lan-bounces@osuosl.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\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 4fGC5M3Ydmz1xpl\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 18 Feb 2026 21:13:27 +1100 (AEDT)","from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id B47BD605EE;\n\tWed, 18 Feb 2026 10:13:24 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id NcSeqfVtzQmb; Wed, 18 Feb 2026 10:13:24 +0000 (UTC)","from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 307B560600;\n\tWed, 18 Feb 2026 10:13:24 +0000 (UTC)","from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists1.osuosl.org (Postfix) with ESMTP id 23CD7206\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Feb 2026 10:13:21 +0000 (UTC)","from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id 4AFE4605D1\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Feb 2026 10:13:20 +0000 (UTC)","from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id HgdOfZh8EiZs for <intel-wired-lan@lists.osuosl.org>;\n Wed, 18 Feb 2026 10:13:19 +0000 (UTC)","from sea.source.kernel.org (sea.source.kernel.org\n [IPv6:2600:3c0a:e001:78e:0:1991:8:25])\n by smtp3.osuosl.org (Postfix) with ESMTPS id B978E605DC\n for <intel-wired-lan@lists.osuosl.org>; Wed, 18 Feb 2026 10:13:19 +0000 (UTC)","from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58])\n by sea.source.kernel.org (Postfix) with ESMTP id 6A7FB44551;\n Wed, 18 Feb 2026 10:13:19 +0000 (UTC)","by smtp.kernel.org (Postfix) with ESMTPSA id 49139C2BCB2;\n Wed, 18 Feb 2026 10:13:19 +0000 (UTC)","from mchehab by mail.kernel.org with local (Exim 4.99.1)\n (envelope-from <mchehab+huawei@kernel.org>)\n id 1vseYX-00000000LOY-1StF; Wed, 18 Feb 2026 11:13:17 +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 smtp3.osuosl.org 307B560600","OpenDKIM Filter v2.11.0 smtp3.osuosl.org B978E605DC"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org;\n\ts=default; t=1771409604;\n\tbh=4yno0WjNYtI6aqq546RSxfVkuNKdS3DKkQ02fdN0FrI=;\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=jK4S99zIXDA8FCQuYjO3YlO7p7Xj79pva6Wr5wH8I1mHg4EU6iHVkQE+0RRFY7DA/\n\t rpE4HHlsUfwRvFEN1xsg2NG9q99tG2kI6xNHJRom8jHB9nf8n6PfDTa99sanmSoRYR\n\t +JipZIJ9qFUJUP2MypySTenFfz4Zc8J8HizEExHg+ooghxNXIm57yPdDSt2XnPHH05\n\t +SV2X3APoGNaGwmysKBDiyu1S+r/VgXwS+sAQwX/4VWtsdwE9YC+ZdvPJ56+A4ZQXL\n\t 8QPd5zAAndhilX7Z9qVxm9fRn1DjPiplgVNsAXFauLQn0XDtTKOY3a4YeFw0j+eNZ2\n\t F/7+v0hs++rYg==","Received-SPF":"Pass (mailfrom) identity=mailfrom;\n client-ip=2600:3c0a:e001:78e:0:1991:8:25; helo=sea.source.kernel.org;\n envelope-from=mchehab+huawei@kernel.org; receiver=<UNKNOWN>","DMARC-Filter":"OpenDMARC Filter v1.4.2 smtp3.osuosl.org B978E605DC","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:34 +0100","Message-ID":"\n <87e79a43714d1de8258c169bf2a8e2ce30705df2.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=1771409599;\n bh=l1TnXg9K1HZGJE+MUFeDj5Ao7LGwzZBBWNXmq8OcdpM=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=MCvrIShRWQOn3kud+SrF72GQRRQoy8OmrR6yjDW5RlNisEJFpIUqVjFy08irxCVc+\n mjZgJcxkDMHVCNC8UshxLFNGBjByVeTTuuEgWLEWwnsvR1pmPN3/4xtswo9q/hiK9p\n gTyhtm4iw/YYOvpvJgtn8QfXn/lXb1oYxajx4Y5vMNt/hqvE1aU/NcV80bjSvHoFhz\n DlJryyoGqHz0vmCsAdDwilJwlqgOlKCISe1RoJf3A1lEtNw1Z3qQEiI+XmsGCvMldf\n Ac1SFPW5V1GguUfndsay9o6/+4fAj69FV+5wDZ98TJ55Alw7jJqSrmYU9TzlndEuii\n ELbd0z/ONbmnQ==","X-Mailman-Original-Authentication-Results":["smtp3.osuosl.org;\n dmarc=pass (p=quarantine dis=none)\n header.from=kernel.org","smtp3.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=MCvrIShR"],"Subject":"[Intel-wired-lan] [PATCH 04/38] docs: kdoc_parser: don't mangle\n with function defines","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":"Mangling with #defines is not nice, as we may end removing\nthe macro names, preventing several macros from being properly\ndocumented.\n\nAlso, on defines, we have something like:\n\n\t#define foo(a1, a2, a3, ...)\t\t\t \\\n\t\t/* some real implementation */\n\nThe prototype part (first line on this example) won't contain\nany macros, so no need to apply any regexes on it.\n\nWith that, move the apply_transforms() logic to ensure that\nit will be called only on functions.\n\nSigned-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>\nAcked-by: Randy Dunlap <rdunlap@infradead.org>\nTested-by: Randy Dunlap <rdunlap@infradead.org>\nReviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>\n---\n tools/lib/python/kdoc/kdoc_parser.py | 12 +++++++-----\n 1 file changed, 7 insertions(+), 5 deletions(-)","diff":"diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py\nindex 68a5aea9175d..9643ffb7584a 100644\n--- a/tools/lib/python/kdoc/kdoc_parser.py\n+++ b/tools/lib/python/kdoc/kdoc_parser.py\n@@ -163,7 +163,7 @@ struct_nested_prefixes = [\n #\n # Transforms for function prototypes\n #\n-function_xforms  = [\n+function_xforms = [\n     (KernRe(r\"^static +\"), \"\"),\n     (KernRe(r\"^extern +\"), \"\"),\n     (KernRe(r\"^asmlinkage +\"), \"\"),\n@@ -1066,10 +1066,7 @@ class KernelDoc:\n         found = func_macro = False\n         return_type = ''\n         decl_type = 'function'\n-        #\n-        # Apply the initial transformations.\n-        #\n-        prototype = apply_transforms(function_xforms, prototype)\n+\n         #\n         # If we have a macro, remove the \"#define\" at the front.\n         #\n@@ -1088,6 +1085,11 @@ class KernelDoc:\n                 declaration_name = r.group(1)\n                 func_macro = True\n                 found = True\n+        else:\n+            #\n+            # Apply the initial transformations.\n+            #\n+            prototype = apply_transforms(function_xforms, prototype)\n \n         # Yes, this truly is vile.  We are looking for:\n         # 1. Return type (may be nothing if we're looking at a macro)\n","prefixes":["04/38"]}