From: "Maciej W. Rozycki" <macro@orcam.me.uk> Date: 2021-10-25 17:10:14
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.
@@ -1380,7 +1380,7 @@ static int fza_probe(struct device *bdev)gotoerr_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
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski [off-list ref]:
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 <redacted>
Fixes: 1e9258c389ee ("fddi: defxx,defza: use dev_addr_set()")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[...]