From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: Arnd Bergmann <arnd@kernel.org>,
Jesse Brandeburg <jesse.brandeburg@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: Re: [PATCH] i40e: fix dma alloc/free prototypes
Date: Wed, 18 Jan 2023 09:57:58 -0800 [thread overview]
Message-ID: <a36a4ac1-5775-f66d-a453-04c7dc1293da@intel.com> (raw)
In-Reply-To: <20230118090120.2081560-1-arnd@kernel.org>
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/
prev parent reply other threads:[~2023-01-18 17:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 9:01 Arnd Bergmann
2023-01-18 17:57 ` Tony Nguyen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a36a4ac1-5775-f66d-a453-04c7dc1293da@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shannon.nelson@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®