Message ID | 20230118090120.2081560-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2247747wrn; Wed, 18 Jan 2023 02:07:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXtdwqArT5GEr+jxqMk34EhWzJv29eAKzhfp/bzD0UlUP0CBi2gaoESBkWcYsIcK/Qb+kOIJ X-Received: by 2002:a05:6402:1c84:b0:49c:d353:8237 with SMTP id cy4-20020a0564021c8400b0049cd3538237mr5815050edb.42.1674036441159; Wed, 18 Jan 2023 02:07:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674036441; cv=none; d=google.com; s=arc-20160816; b=VKvYaua4yCNXweGcVeWS3WxWeqP8WYw3BU+s83+ZsakSfOUBgoFWrKbHP1QMHf/Few 8qgs9c1w1llYQnp4jVhL3mqtg7i7JMSEJ0WzUsNJS5gkPF/5yPcWzLhyK8wab1Hha5Wt L9h7m1JuQLW1KT1oSbN2vZCqcZ6Xa84DLiIilZsDFEn7Nh3z9zUc4ALG3A5QdB3hIE8T 4GMD/oaN1qvrefNNBcvkSg0tcyLvXMcmJsHyToulnrtAlh5QfZUBAVUJS1o5sBMVbr54 SR9W7O0oFOyZFvzjg+3Dr/PZ3egAzSdjWxqslAwFXHgxWLQSz6Dm6/yFMImTHmr76UVf NUzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FLIUMPj7CyVmUkuepP5kkqokVy/8sJ+ouqn3gcxcM/w=; b=vXRjXUCH9IeF0xddCjxpLeUI4CkkjrIiZGlg1ZDgfV3wifo31DJwRffnkHrUHWFVcT Q8DLcjPdfpes0eQn9pQYq6lgcf9IOMLmgHuCiAhVf2rXu43eogoDlzDZlGmZZkfC0rAs ZX3c/EmT/mwgN9UFw3+yWBehVr6uvLawmen5Wj1A73EOEFmW4mycTegAQqoAlQbsD5li 8ecd25x5Iyk/A7OglPuC2okODtIKKKlk8NKMqfnl8YFoDsqTBxA/P2cNeG03xyTaB9C8 LD591+gLGfO+UMP+2K8d+B233zGzAvxGh8bYGYbPZ2iTh1QBDpQ3kdVIJVpS7/8Sho5t QsLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f2ti79ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020a05640203d500b0046f9bcabfe6si13859638edw.601.2023.01.18.02.06.56; Wed, 18 Jan 2023 02:07:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f2ti79ww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230176AbjARJu7 (ORCPT <rfc822;pfffrao@gmail.com> + 99 others); Wed, 18 Jan 2023 04:50:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbjARJt4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Jan 2023 04:49:56 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1A5B611CF; Wed, 18 Jan 2023 01:01:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03C6B61734; Wed, 18 Jan 2023 09:01:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8FBEC433D2; Wed, 18 Jan 2023 09:01:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674032485; bh=NLYd7TN6vH/s+v7UK420x0jDdP0vK/RzDH5BQQI3Y18=; h=From:To:Cc:Subject:Date:From; b=f2ti79ww970dIOt3KZ0XH9Tuw2nWIvtSyhV5GxRydxxL2HkeIJGviT3aWAp8dCcec fFBdV1Z/Vcm4InuSIId2ZPOSVpU1k0e5lvf72w/CVbBYd0oTDqiWjQnKzxge+e2vgh dy78n3FwHREzxmd/NQtu8fg2/qW9RPEAIx2fqevG1XQzK/YDF+g/jXQqNnzeoeOIjo NCcjymomjT7hFr520Ls2+UnkqDqLroQeaoJu/PrxCDou0oRlB3PXgOK1J3ijyeo4V1 aiELqaE3n8eiW7TtHPG6NWzSzz/YOeog64RLE18uhNUMnFTT7/doyCH9dRVRZG/Dit 32w9+xG+ZlgCA== From: Arnd Bergmann <arnd@kernel.org> To: Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Shannon Nelson <shannon.nelson@intel.com>, Jeff Kirsher <jeffrey.t.kirsher@intel.com> Cc: Arnd Bergmann <arnd@arndb.de>, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i40e: fix dma alloc/free prototypes Date: Wed, 18 Jan 2023 10:01:05 +0100 Message-Id: <20230118090120.2081560-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755354435695304556?= X-GMAIL-MSGID: =?utf-8?q?1755354435695304556?= |
Series |
i40e: fix dma alloc/free prototypes
|
|
Commit Message
Arnd Bergmann
Jan. 18, 2023, 9:01 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de> gcc-13 notices a mismatch between the declaration and the definition for a few functions that apparently used to return a i40e_status_code instead of an int: drivers/net/ethernet/intel/i40e/i40e_main.c:129:5: error: conflicting types for 'i40e_allocate_dma_mem_d' due to enum/integer mismatch; have 'int(struct i40e_hw *, struct i40e_dma_mem *, u64, u32)' {aka 'int(struct i40e_hw *, struct i40e_dma_mem *, long long unsigned int, unsigned int)'} [-Werror=enum-int-mismatch] 129 | int i40e_allocate_dma_mem_d(struct i40e_hw *hw, struct i40e_dma_mem *mem, | ^~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/net/ethernet/intel/i40e/i40e_type.h:8, from drivers/net/ethernet/intel/i40e/i40e.h:41, from drivers/net/ethernet/intel/i40e/i40e_main.c:12: drivers/net/ethernet/intel/i40e/i40e_osdep.h:40:25: note: previous declaration of 'i40e_allocate_dma_mem_d' with type 'i40e_status(struct i40e_hw *, struct i40e_dma_mem *, u64, u32)' {aka 'enum i40e_status_code(struct i40e_hw *, struct i40e_dma_mem *, long long unsigned int, unsigned int)'} 40 | i40e_allocate_dma_mem_d(h, m, s, a) | ^~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/intel/i40e/i40e_alloc.h:23:13: note: in expansion of macro 'i40e_allocate_dma_mem' 23 | i40e_status i40e_allocate_dma_mem(struct i40e_hw *hw, | ^~~~~~~~~~~~~~~~~~~~~ Change the prototypes to match the definition. Fixes: 56a62fc86895 ("i40e: init code and hardware support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/net/ethernet/intel/i40e/i40e_alloc.h | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-)
Comments
On 1/18/2023 1:01 AM, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > gcc-13 notices a mismatch between the declaration and the definition > for a few functions that apparently used to return a i40e_status_code > instead of an int: > > drivers/net/ethernet/intel/i40e/i40e_main.c:129:5: error: conflicting types for 'i40e_allocate_dma_mem_d' due to enum/integer mismatch; have 'int(struct i40e_hw *, struct i40e_dma_mem *, u64, u32)' {aka 'int(struct i40e_hw *, struct i40e_dma_mem *, long long unsigned int, unsigned int)'} [-Werror=enum-int-mismatch] > 129 | int i40e_allocate_dma_mem_d(struct i40e_hw *hw, struct i40e_dma_mem *mem, > | ^~~~~~~~~~~~~~~~~~~~~~~ > In file included from drivers/net/ethernet/intel/i40e/i40e_type.h:8, > from drivers/net/ethernet/intel/i40e/i40e.h:41, > from drivers/net/ethernet/intel/i40e/i40e_main.c:12: > drivers/net/ethernet/intel/i40e/i40e_osdep.h:40:25: note: previous declaration of 'i40e_allocate_dma_mem_d' with type 'i40e_status(struct i40e_hw *, struct i40e_dma_mem *, u64, u32)' {aka 'enum i40e_status_code(struct i40e_hw *, struct i40e_dma_mem *, long long unsigned int, unsigned int)'} > 40 | i40e_allocate_dma_mem_d(h, m, s, a) > | ^~~~~~~~~~~~~~~~~~~~~~~ > drivers/net/ethernet/intel/i40e/i40e_alloc.h:23:13: note: in expansion of macro 'i40e_allocate_dma_mem' > 23 | i40e_status i40e_allocate_dma_mem(struct i40e_hw *hw, > | ^~~~~~~~~~~~~~~~~~~~~ > > Change the prototypes to match the definition. Thanks for the patch Arnd, however, the problem with this is the call chain of these functions are returning i40e_status which, with the propagated values of these functions, will push the warnings up I assume. We have a series coming to remove i40e_status altogether [1] which should resolve this issue. Thanks, Tony > Fixes: 56a62fc86895 ("i40e: init code and hardware support") > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > --- > drivers/net/ethernet/intel/i40e/i40e_alloc.h | 20 +++++++++----------- > 1 file changed, 9 insertions(+), 11 deletions(-) > > diff --git a/drivers/net/ethernet/intel/i40e/i40e_alloc.h b/drivers/net/ethernet/intel/i40e/i40e_alloc.h > index cb8689222c8b..e9c4a8fda9de 100644 > --- a/drivers/net/ethernet/intel/i40e/i40e_alloc.h > +++ b/drivers/net/ethernet/intel/i40e/i40e_alloc.h > @@ -20,16 +20,14 @@ enum i40e_memory_type { > }; > > /* prototype for functions used for dynamic memory allocation */ > -i40e_status i40e_allocate_dma_mem(struct i40e_hw *hw, > - struct i40e_dma_mem *mem, > - enum i40e_memory_type type, > - u64 size, u32 alignment); > -i40e_status i40e_free_dma_mem(struct i40e_hw *hw, > - struct i40e_dma_mem *mem); > -i40e_status i40e_allocate_virt_mem(struct i40e_hw *hw, > - struct i40e_virt_mem *mem, > - u32 size); > -i40e_status i40e_free_virt_mem(struct i40e_hw *hw, > - struct i40e_virt_mem *mem); > +int i40e_allocate_dma_mem(struct i40e_hw *hw, > + struct i40e_dma_mem *mem, > + enum i40e_memory_type type, > + u64 size, u32 alignment); > +int i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem); > +int i40e_allocate_virt_mem(struct i40e_hw *hw, > + struct i40e_virt_mem *mem, > + u32 size); > +int i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem); > > #endif /* _I40E_ALLOC_H_ */ [1] https://lore.kernel.org/intel-wired-lan/20230109141120.3197817-1-jan.sokolowski@intel.com/
diff --git a/drivers/net/ethernet/intel/i40e/i40e_alloc.h b/drivers/net/ethernet/intel/i40e/i40e_alloc.h index cb8689222c8b..e9c4a8fda9de 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_alloc.h +++ b/drivers/net/ethernet/intel/i40e/i40e_alloc.h @@ -20,16 +20,14 @@ enum i40e_memory_type { }; /* prototype for functions used for dynamic memory allocation */ -i40e_status i40e_allocate_dma_mem(struct i40e_hw *hw, - struct i40e_dma_mem *mem, - enum i40e_memory_type type, - u64 size, u32 alignment); -i40e_status i40e_free_dma_mem(struct i40e_hw *hw, - struct i40e_dma_mem *mem); -i40e_status i40e_allocate_virt_mem(struct i40e_hw *hw, - struct i40e_virt_mem *mem, - u32 size); -i40e_status i40e_free_virt_mem(struct i40e_hw *hw, - struct i40e_virt_mem *mem); +int i40e_allocate_dma_mem(struct i40e_hw *hw, + struct i40e_dma_mem *mem, + enum i40e_memory_type type, + u64 size, u32 alignment); +int i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem); +int i40e_allocate_virt_mem(struct i40e_hw *hw, + struct i40e_virt_mem *mem, + u32 size); +int i40e_free_virt_mem(struct i40e_hw *hw, struct i40e_virt_mem *mem); #endif /* _I40E_ALLOC_H_ */