All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] fddi: defza: add missing pointer type cast
@ 2021-10-25 16:00 Jakub Kicinski
  2021-10-25 17:09 ` Maciej W. Rozycki
  2021-10-25 17:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2021-10-25 16:00 UTC (permalink / raw)
  To: davem; +Cc: netdev, macro, Jakub Kicinski, kernel test robot

hw_addr is a uint AKA unsigned int. dev_addr_set() takes
a u8 *.

  drivers/net/fddi/defza.c:1383:27: error: passing argument 2 of 'dev_addr_set' from incompatible pointer type [-Werror=incompatible-pointer-types]

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 1e9258c389ee ("fddi: defxx,defza: use dev_addr_set()")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/fddi/defza.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fddi/defza.c b/drivers/net/fddi/defza.c
index 3a6b08eb5e1b..f5c25acaa577 100644
--- a/drivers/net/fddi/defza.c
+++ b/drivers/net/fddi/defza.c
@@ -1380,7 +1380,7 @@ static int fza_probe(struct device *bdev)
 		goto err_out_irq;
 
 	fza_reads(&init->hw_addr, &hw_addr, sizeof(hw_addr));
-	dev_addr_set(dev, &hw_addr);
+	dev_addr_set(dev, (u8 *)&hw_addr);
 
 	fza_reads(&init->rom_rev, &rom_rev, sizeof(rom_rev));
 	fza_reads(&init->fw_rev, &fw_rev, sizeof(fw_rev));
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] fddi: defza: add missing pointer type cast
  2021-10-25 16:00 [PATCH net-next] fddi: defza: add missing pointer type cast Jakub Kicinski
@ 2021-10-25 17:09 ` Maciej W. Rozycki
  2021-10-25 17:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2021-10-25 17:09 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: David S. Miller, netdev, kernel test robot

On Mon, 25 Oct 2021, Jakub Kicinski wrote:

> hw_addr is a uint AKA unsigned int. dev_addr_set() takes
> a u8 *.

 Hmm, that's for alignment purposes to keep accessors simple (and somewhat 
faster) as hardware ignores byte lane enables, though having had a look at 
`fza_reads' something seems fishy to me here and I think `hw_addr' should 
be `u64' rather than `uint[2]'.  I'll have to double-check alignments 
throughout `struct fza_cmd_init' too and possibly elsewhere.  Unaligned 
accesses will trap and will be emulated even in the kernel mode (we need 
that for some IP packet header processing too), but obviously performance 
will suck.

> diff --git a/drivers/net/fddi/defza.c b/drivers/net/fddi/defza.c
> index 3a6b08eb5e1b..f5c25acaa577 100644
> --- a/drivers/net/fddi/defza.c
> +++ b/drivers/net/fddi/defza.c
> @@ -1380,7 +1380,7 @@ static int fza_probe(struct device *bdev)
>  		goto err_out_irq;
>  
>  	fza_reads(&init->hw_addr, &hw_addr, sizeof(hw_addr));
> -	dev_addr_set(dev, &hw_addr);
> +	dev_addr_set(dev, (u8 *)&hw_addr);

 A union would be cleaner rather than having the type punned, but let's 
keep it like you proposed for now.

Acked-by: Maciej W. Rozycki <macro@orcam.me.uk>

  Maciej

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] fddi: defza: add missing pointer type cast
  2021-10-25 16:00 [PATCH net-next] fddi: defza: add missing pointer type cast Jakub Kicinski
  2021-10-25 17:09 ` Maciej W. Rozycki
@ 2021-10-25 17:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-25 17:40 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, macro, lkp

Hello:

This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:

On Mon, 25 Oct 2021 09:00:00 -0700 you wrote:
> hw_addr is a uint AKA unsigned int. dev_addr_set() takes
> a u8 *.
> 
>   drivers/net/fddi/defza.c:1383:27: error: passing argument 2 of 'dev_addr_set' from incompatible pointer type [-Werror=incompatible-pointer-types]
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 1e9258c389ee ("fddi: defxx,defza: use dev_addr_set()")
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

Here is the summary with links:
  - [net-next] fddi: defza: add missing pointer type cast
    https://git.kernel.org/netdev/net-next/c/a0c8c3372b41

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-10-25 17:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-25 16:00 [PATCH net-next] fddi: defza: add missing pointer type cast Jakub Kicinski
2021-10-25 17:09 ` Maciej W. Rozycki
2021-10-25 17: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.