From patchwork Mon Aug 14 17:07:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Kumar Linga X-Patchwork-Id: 13353121 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 88770C8FD for ; Mon, 14 Aug 2023 17:11:29 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DB5EE6A; Mon, 14 Aug 2023 10:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692033088; x=1723569088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5KydbXEvfYn/uPRun8gzokjqDD+u6EXaH58nS3MHzj4=; b=imhugZCein1en6l1UMHUD8TkMESUbHxlVWcfg8QOpGwDLgw4YvyDBkGY 6RgWGLJod1D6REaFO+rnVys6GBowzqQ1rjyCWOAdM4NdQjLmko72PUtq7 vJt0fMhCW1fc9eOPcVlnjY6hualBknz2oj4S5UPq07xrT6J0ZxnnPTM8G jAeN60P6NNt4WMsJxtJ6riCdmtwYlPRe75B0iN3pIekulI+4ssvfiBafO 5lL8j7TxqTXwRYFONo3yjuKlCItIQFJdAbfI6QO3aqy1RDmCBxQCp1cVt UreoQymD+np47O9aJsVxbhRkf9MgxTctWnAPOc91sDQyTvtjYN5LmP4/p A==; X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="435983118" X-IronPort-AV: E=Sophos;i="6.01,173,1684825200"; d="scan'208";a="435983118" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2023 10:11:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="763011324" X-IronPort-AV: E=Sophos;i="6.01,173,1684825200"; d="scan'208";a="763011324" Received: from unknown (HELO fedora.jf.intel.com) ([10.166.80.24]) by orsmga008.jf.intel.com with ESMTP; 14 Aug 2023 10:11:18 -0700 From: Pavan Kumar Linga To: netdev@vger.kernel.org, kuba@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, emil.s.tantilov@intel.com, joshua.a.hay@intel.com, sridhar.samudrala@intel.com, alan.brady@intel.com, madhu.chittim@intel.com, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, willemb@google.com, decot@google.com, rdunlap@infradead.org, Pavan Kumar Linga Subject: [PATCH net-next v2 1/2] scripts: kernel-doc: parse DEFINE_DMA_UNMAP_[ADDR|LEN] Date: Mon, 14 Aug 2023 10:07:19 -0700 Message-Id: <20230814170720.46229-2-pavan.kumar.linga@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230814170720.46229-1-pavan.kumar.linga@intel.com> References: <20230814170720.46229-1-pavan.kumar.linga@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org At present, if the macros DEFINE_DMA_UNMAP_ADDR() and DEFINE_DMA_UNMAP_LEN() are used in the structures as shown below, instead of parsing the parameter in the parentheses, kernel-doc parses 'DEFINE_DMA_UNMAP_ADDR(' and 'DEFINE_DMA_UNMAP_LEN(' which results in the following warnings: drivers/net/ethernet/intel/idpf/idpf_txrx.h:201: warning: Function parameter or member 'DEFINE_DMA_UNMAP_ADDR(dma' not described in 'idpf_tx_buf' drivers/net/ethernet/intel/idpf/idpf_txrx.h:201: warning: Function parameter or member 'DEFINE_DMA_UNMAP_LEN(len' not described in 'idpf_tx_buf' struct idpf_tx_buf { DEFINE_DMA_UNMAP_ADDR(dma); DEFINE_DMA_UNMAP_LEN(len); }; Fix the warnings by parsing DEFINE_DMA_UNMAP_ADDR() and DEFINE_DMA_UNMAP_LEN(). Signed-off-by: Pavan Kumar Linga Acked-by: Randy Dunlap --- scripts/kernel-doc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d0116c6939dc..cfb1cb223508 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1168,6 +1168,10 @@ sub dump_struct($$) { $members =~ s/DECLARE_KFIFO_PTR\s*\($args,\s*$args\)/$2 \*$1/gos; # replace DECLARE_FLEX_ARRAY $members =~ s/(?:__)?DECLARE_FLEX_ARRAY\s*\($args,\s*$args\)/$1 $2\[\]/gos; + #replace DEFINE_DMA_UNMAP_ADDR + $members =~ s/DEFINE_DMA_UNMAP_ADDR\s*\($args\)/dma_addr_t $1/gos; + #replace DEFINE_DMA_UNMAP_LEN + $members =~ s/DEFINE_DMA_UNMAP_LEN\s*\($args\)/__u32 $1/gos; my $declaration = $members; # Split nested struct/union elements as newer ones From patchwork Mon Aug 14 17:07:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavan Kumar Linga X-Patchwork-Id: 13353120 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 3B09CC8EC for ; Mon, 14 Aug 2023 17:11:29 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 645A2E65; Mon, 14 Aug 2023 10:11:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1692033088; x=1723569088; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ysMqtPzA8PYAd9Hg+oD2xo4hcLn3pI1vfNhUHnEeKWo=; b=MOiaZOTIF8vjeRyc1xLRspqPB8oKX/16ZksDuA5hP0QhCVnyudAVhx3T f4qiREUVPYJ3mq6VX1RO30OnRfEUjqk+u9HOWcJ0hY/J8Nj2pArMGLAJP qk5/qKN+VeQlSjZffVbtPBkSU9Oo9dMf/qLmRbBulr/MMBwiKsFkhjUOi xWEVSuv7vCausB0Q1+XNaBUb4GX9qyTsWTafLER/ZSmj8Lvj4V0zS8RBg L8Gg/YdOSKaRFkXQGFUmWga17fcDyiK6EwKwLqqL4VPWOjEcnbDI4P3Qs 4TBvqb17v/XV5lBD85Nr1LToBeTBBMVV5TevI5AHdL3WCtJ+kkG/ZNcjw g==; X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="435983123" X-IronPort-AV: E=Sophos;i="6.01,173,1684825200"; d="scan'208";a="435983123" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Aug 2023 10:11:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10802"; a="763011329" X-IronPort-AV: E=Sophos;i="6.01,173,1684825200"; d="scan'208";a="763011329" Received: from unknown (HELO fedora.jf.intel.com) ([10.166.80.24]) by orsmga008.jf.intel.com with ESMTP; 14 Aug 2023 10:11:19 -0700 From: Pavan Kumar Linga To: netdev@vger.kernel.org, kuba@kernel.org Cc: linux-doc@vger.kernel.org, corbet@lwn.net, emil.s.tantilov@intel.com, joshua.a.hay@intel.com, sridhar.samudrala@intel.com, alan.brady@intel.com, madhu.chittim@intel.com, jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, willemb@google.com, decot@google.com, rdunlap@infradead.org, Pavan Kumar Linga Subject: [PATCH net-next v2 2/2] scripts: kernel-doc: fix macro handling in enums Date: Mon, 14 Aug 2023 10:07:20 -0700 Message-Id: <20230814170720.46229-3-pavan.kumar.linga@intel.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230814170720.46229-1-pavan.kumar.linga@intel.com> References: <20230814170720.46229-1-pavan.kumar.linga@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org drivers/net/ethernet/intel/idpf/idpf.h uses offsetof to initialize the enum enumerators: enum { IDPF_BASE_CAPS = -1, IDPF_CSUM_CAPS = offsetof(struct virtchnl2_get_capabilities, csum_caps), IDPF_SEG_CAPS = offsetof(struct virtchnl2_get_capabilities, seg_caps), IDPF_RSS_CAPS = offsetof(struct virtchnl2_get_capabilities, rss_caps), IDPF_HSPLIT_CAPS = offsetof(struct virtchnl2_get_capabilities, hsplit_caps), IDPF_RSC_CAPS = offsetof(struct virtchnl2_get_capabilities, rsc_caps), IDPF_OTHER_CAPS = offsetof(struct virtchnl2_get_capabilities, other_caps), }; kernel-doc parses the above enumerator with a ',' inside the macro and treats 'csum_caps', 'seg_caps' etc. also as enumerators resulting in the warnings: drivers/net/ethernet/intel/idpf/idpf.h:130: warning: Enum value 'csum_caps' not described in enum 'idpf_cap_field' drivers/net/ethernet/intel/idpf/idpf.h:130: warning: Enum value 'seg_caps' not described in enum 'idpf_cap_field' drivers/net/ethernet/intel/idpf/idpf.h:130: warning: Enum value 'rss_caps' not described in enum 'idpf_cap_field' drivers/net/ethernet/intel/idpf/idpf.h:130: warning: Enum value 'hsplit_caps' not described in enum 'idpf_cap_field' drivers/net/ethernet/intel/idpf/idpf.h:130: warning: Enum value 'rsc_caps' not described in enum 'idpf_cap_field' drivers/net/ethernet/intel/idpf/idpf.h:130: warning: Enum value 'other_caps' not described in enum 'idpf_cap_field' Fix it by removing the macro arguments within the parentheses. Signed-off-by: Pavan Kumar Linga --- scripts/kernel-doc | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index cfb1cb223508..bc008f30f3c9 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1353,6 +1353,7 @@ sub dump_enum($$) { my %_members; $members =~ s/\s+$//; + $members =~ s/\(.*?[\)]//g; foreach my $arg (split ',', $members) { $arg =~ s/^\s*(\w+).*/$1/;