* [PATCH] net: ni65: Avoid typecast of pointer to u32
@ 2021-09-09 4:49 Guenter Roeck
2021-09-09 8:15 ` Arnd Bergmann
2021-09-09 10:40 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Guenter Roeck @ 2021-09-09 4:49 UTC (permalink / raw)
To: David S . Miller
Cc: Jakub Kicinski, netdev, linux-kernel, Guenter Roeck, Arnd Bergmann
Building alpha:allmodconfig results in the following error.
drivers/net/ethernet/amd/ni65.c: In function 'ni65_stop_start':
drivers/net/ethernet/amd/ni65.c:751:37: error:
cast from pointer to integer of different size
buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
'buffer[]' is declared as unsigned long, so replace the typecast to u32
with a typecast to unsigned long to fix the problem.
Cc: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/net/ethernet/amd/ni65.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
index b5df7ad5a83f..032e8922b482 100644
--- a/drivers/net/ethernet/amd/ni65.c
+++ b/drivers/net/ethernet/amd/ni65.c
@@ -748,7 +748,7 @@ static void ni65_stop_start(struct net_device *dev,struct priv *p)
#ifdef XMT_VIA_SKB
skb_save[i] = p->tmd_skb[i];
#endif
- buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
+ buffer[i] = (unsigned long)isa_bus_to_virt(tmdp->u.buffer);
blen[i] = tmdp->blen;
tmdp->u.s.status = 0x0;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ni65: Avoid typecast of pointer to u32
2021-09-09 4:49 [PATCH] net: ni65: Avoid typecast of pointer to u32 Guenter Roeck
@ 2021-09-09 8:15 ` Arnd Bergmann
2021-09-09 10:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-09-09 8:15 UTC (permalink / raw)
To: Guenter Roeck
Cc: David S . Miller, Jakub Kicinski, Networking, Linux Kernel Mailing List
On Thu, Sep 9, 2021 at 6:50 AM Guenter Roeck <linux@roeck-us.net> wrote:
>
> Building alpha:allmodconfig results in the following error.
>
> drivers/net/ethernet/amd/ni65.c: In function 'ni65_stop_start':
> drivers/net/ethernet/amd/ni65.c:751:37: error:
> cast from pointer to integer of different size
> buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
>
> 'buffer[]' is declared as unsigned long, so replace the typecast to u32
> with a typecast to unsigned long to fix the problem.
>
> Cc: Arnd Bergmann <arnd@kernel.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/ethernet/amd/ni65.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/amd/ni65.c b/drivers/net/ethernet/amd/ni65.c
> index b5df7ad5a83f..032e8922b482 100644
> --- a/drivers/net/ethernet/amd/ni65.c
> +++ b/drivers/net/ethernet/amd/ni65.c
> @@ -748,7 +748,7 @@ static void ni65_stop_start(struct net_device *dev,struct priv *p)
> #ifdef XMT_VIA_SKB
> skb_save[i] = p->tmd_skb[i];
> #endif
> - buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
> + buffer[i] = (unsigned long)isa_bus_to_virt(tmdp->u.buffer);
I generally prefer uintptr_t over unsigned long for this cast because it's more
descriptive, but the effect is the same.
Arnd
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: ni65: Avoid typecast of pointer to u32
2021-09-09 4:49 [PATCH] net: ni65: Avoid typecast of pointer to u32 Guenter Roeck
2021-09-09 8:15 ` Arnd Bergmann
@ 2021-09-09 10:40 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-09-09 10:40 UTC (permalink / raw)
To: Guenter Roeck; +Cc: davem, kuba, netdev, linux-kernel, arnd
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
On Wed, 8 Sep 2021 21:49:53 -0700 you wrote:
> Building alpha:allmodconfig results in the following error.
>
> drivers/net/ethernet/amd/ni65.c: In function 'ni65_stop_start':
> drivers/net/ethernet/amd/ni65.c:751:37: error:
> cast from pointer to integer of different size
> buffer[i] = (u32) isa_bus_to_virt(tmdp->u.buffer);
>
> [...]
Here is the summary with links:
- net: ni65: Avoid typecast of pointer to u32
https://git.kernel.org/netdev/net/c/e011912651bd
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-09 10:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-09 4:49 [PATCH] net: ni65: Avoid typecast of pointer to u32 Guenter Roeck
2021-09-09 8:15 ` Arnd Bergmann
2021-09-09 10:40 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.