]> git.baikalelectronics.ru Git - kernel.git/commit
net: apple: bmac: Fix build since dev_addr constification
authorMichael Ellerman <mpe@ellerman.id.au>
Fri, 14 Jan 2022 03:13:16 +0000 (14:13 +1100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Jan 2022 11:22:57 +0000 (11:22 +0000)
commitf57a06ea94a7c5e468ce15d60a4cb6e6ce887309
tree190559781089a1f38aad84f7091252a116a7cbe7
parent752ec2070a033c9078e060b8499768ffb42221f8
net: apple: bmac: Fix build since dev_addr constification

Since commit 7e08762fb607 ("net: constify netdev->dev_addr") the bmac
driver no longer builds with the following errors (pmac32_defconfig):

  linux/drivers/net/ethernet/apple/bmac.c: In function ‘bmac_probe’:
  linux/drivers/net/ethernet/apple/bmac.c:1287:20: error: assignment of read-only location ‘*(dev->dev_addr + (sizetype)j)’
   1287 |   dev->dev_addr[j] = rev ? bitrev8(addr[j]): addr[j];
        |                    ^

Fix it by making the modifications to a local macaddr variable and then
passing that to eth_hw_addr_set().

We don't use the existing addr variable because the bitrev8() would
mutate it, but it is already used unreversed later in the function.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/apple/bmac.c