From: Simon Horman <horms@kernel.org>
To: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Pantelis Antoniou <pantelis.antoniou@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH net] net: fs_enet: Fix warning due to wrong type
Date: Fri, 9 Aug 2024 10:49:51 +0100 [thread overview]
Message-ID: <20240809094951.GI3075665@kernel.org> (raw)
In-Reply-To: <ec67ea3a3bef7e58b8dc959f7c17d405af0d27e4.1723101144.git.christophe.leroy@csgroup.eu>
On Thu, Aug 08, 2024 at 09:16:48AM +0200, Christophe Leroy wrote:
> Building fs_enet on powerpc e500 leads to following warning:
>
> CC drivers/net/ethernet/freescale/fs_enet/mac-scc.o
> In file included from ./include/linux/build_bug.h:5,
> from ./include/linux/container_of.h:5,
> from ./include/linux/list.h:5,
> from ./include/linux/module.h:12,
> from drivers/net/ethernet/freescale/fs_enet/mac-scc.c:15:
> drivers/net/ethernet/freescale/fs_enet/mac-scc.c: In function 'allocate_bd':
> ./include/linux/err.h:28:49: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 28 | #define IS_ERR_VALUE(x) unlikely((unsigned long)(void *)(x) >= (unsigned long)-MAX_ERRNO)
> | ^
> ./include/linux/compiler.h:77:45: note: in definition of macro 'unlikely'
> 77 | # define unlikely(x) __builtin_expect(!!(x), 0)
> | ^
> drivers/net/ethernet/freescale/fs_enet/mac-scc.c:138:13: note: in expansion of macro 'IS_ERR_VALUE'
> 138 | if (IS_ERR_VALUE(fep->ring_mem_addr))
> | ^~~~~~~~~~~~
>
> This is due to fep->ring_mem_addr not being a pointer but a DMA
> address which is 64 bits on that platform while pointers are
> 32 bits as this is a 32 bits platform with wider physical bus.
>
> However, using fep->ring_mem_addr is just wrong because
> cpm_muram_alloc() returns an offset within the muram and not
> a physical address directly. So use fpi->dpram_offset instead.
>
> Fixes: 48257c4f168e ("Add fs_enet ethernet network driver, for several embedded platforms.")
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2024-08-09 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 7:16 [PATCH net] net: fs_enet: Fix warning due to wrong type Christophe Leroy
2024-08-09 9:49 ` Simon Horman [this message]
2024-08-10 5:20 ` patchwork-bot+netdevbpf
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=20240809094951.GI3075665@kernel.org \
--to=horms@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pantelis.antoniou@gmail.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;
as well as URLs for NNTP newsgroup(s).