From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6E6A0D3F083 for ; Wed, 28 Jan 2026 16:50:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 28954406F9; Wed, 28 Jan 2026 16:50:36 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ufqZPnWPiS5K; Wed, 28 Jan 2026 16:50:34 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 3D7BC405E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1769619034; bh=DHh4XZknUAhvv3nqVS+tgCZnpCAfdlJaqFfs2SALZms=; h=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=RWQ1YjpQHcmxqWCecELZpgXT5WPAwyFLDKGq2DcYGKhGzXgyFVdge+8u1BRzTbPFW MSjILD4DWRcEv61/k95V+M6MOocV5GC4YVZu7svLyAjbX9oHLewyglfPklFIemodq+ W7TdTYeVbn7SlWmYjP9ZHPlvbEHAKv4gdoP2Tq06dQdcy7diwhTIzW+aIvW+5ZM2jT x+oHkFpp9x/K+C4z91uWHZaVkMaINXDOKW+bJnaeD6Pz3aAChULLUxe9A/tO3K7vpM 13gg4OZoPtE+lqedw4bTaGWEOsiHP2s7pX5k4g17dVb+povFd/CCmHXCDExwzdsk+E 2hn1WB6xfn73g== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 3D7BC405E9; Wed, 28 Jan 2026 16:50:34 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists1.osuosl.org (Postfix) with ESMTP id D439C160 for ; Wed, 28 Jan 2026 16:50:32 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C54E260774 for ; Wed, 28 Jan 2026 16:50:32 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id E8SmOmEbuDnK for ; Wed, 28 Jan 2026 16:50:32 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.252.31; helo=sea.source.kernel.org; envelope-from=mchehab+huawei@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 2DC6660643 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2DC6660643 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2DC6660643 for ; Wed, 28 Jan 2026 16:50:32 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id D470443C67; Wed, 28 Jan 2026 16:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B29A8C16AAE; Wed, 28 Jan 2026 16:50:31 +0000 (UTC) Received: from mchehab by mail.kernel.org with local (Exim 4.99.1) (envelope-from ) id 1vl8kP-0000000DAoJ-3ZM3; Wed, 28 Jan 2026 17:50:29 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , bpf@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Peter Zijlstra , Randy Dunlap , Stephen Rothwell Date: Wed, 28 Jan 2026 17:50:02 +0100 Message-ID: <05cf7e030b659f26ebc4fdc65e264ea9616c9d9d.1769617841.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: References: 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; d=kernel.org; s=k20201202; t=1769619031; bh=cuKy1d1D0xiQwJcdcAdfKB7F5IpylCi/Hc8WUScKfcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LnuH8udNWV3JcvZ1e6laVHL0sFlIGbyZ6iWd8jYwZx6/7G4qJNtaF80Y+Cp87/bdz vk/e0AZUIXJlTyQGjj64algtpG8eAfAf1MjNDTMD5xQOn0DLCQaaA/z6+jMCWbYphs whcNXpuGtleC01nJ45Oy9wPKrBCEaVzthZ6cZQtf1Mmv+f2XMrJHV354VHBgPbgZDY Ej4CGDN9f+KS6fzg0oS+W1BnE3kyD9Zm3WLLB36rYHbN/wPaOn62m8kmC9bhslgK76 0DzEOEH8xViMIgyHE1GwXif3L5CcCoNjY4+sYFfLUBuDWPj9fM1ThFpJEDuVEy1Dlh yvV6j99dJ5QGQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=LnuH8udN Subject: [Intel-wired-lan] [PATCH v2 04/25] docs: kdoc_parser: don't mangle 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" Mangling with #defines is not nice, as we may end removing the macro names, preventing several macros from being properly documented. Also, on defines, we have something like: #define foo(a1, a2, a3, ...) \ /* some real implementation */ The prototype part (first line on this example) won't contain any macros, so no need to apply any regexes on it. With that, move the apply_transforms() logic to ensure that it will be called only on functions. Signed-off-by: Mauro Carvalho Chehab Acked-by: Randy Dunlap Tested-by: Randy Dunlap --- tools/lib/python/kdoc/kdoc_parser.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/lib/python/kdoc/kdoc_parser.py b/tools/lib/python/kdoc/kdoc_parser.py index 0b68b140cd02..3ba2cda2487a 100644 --- a/tools/lib/python/kdoc/kdoc_parser.py +++ b/tools/lib/python/kdoc/kdoc_parser.py @@ -163,7 +163,7 @@ struct_nested_prefixes = [ # # Transforms for function prototypes # -function_xforms = [ +function_xforms = [ (KernRe(r"^static +"), ""), (KernRe(r"^extern +"), ""), (KernRe(r"^asmlinkage +"), ""), @@ -1065,10 +1065,7 @@ class KernelDoc: found = func_macro = False return_type = '' decl_type = 'function' - # - # Apply the initial transformations. - # - prototype = apply_transforms(function_xforms, prototype) + # # If we have a macro, remove the "#define" at the front. # @@ -1087,6 +1084,11 @@ class KernelDoc: declaration_name = r.group(1) func_macro = True found = True + else: + # + # Apply the initial transformations. + # + prototype = apply_transforms(function_xforms, prototype) # Yes, this truly is vile. We are looking for: # 1. Return type (may be nothing if we're looking at a macro) -- 2.52.0