Skip to content
Snippets Groups Projects
Commit f9050f1c authored by Rosen Penev's avatar Rosen Penev Committed by Paul Spooren
Browse files

bcm63xx: remove memcpy from mac assignment


With GCC11, memcpy doesn't work here as it assumes a size of 0. Use
ioremap to avoid it.

Fixed parameter type to match board_get_mac_address.

Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
parent 753f2f1e
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support ...@@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
#endif /* __BOARD_COMMON_H */ #endif /* __BOARD_COMMON_H */
--- /dev/null --- /dev/null
+++ b/arch/mips/bcm63xx/boards/board_livebox.c +++ b/arch/mips/bcm63xx/boards/board_livebox.c
@@ -0,0 +1,153 @@ @@ -0,0 +1,158 @@
+/* +/*
+ * This file is subject to the terms and conditions of the GNU General Public + * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive + * License. See the file "COPYING" in the main directory of this archive
...@@ -130,12 +130,17 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support ...@@ -130,12 +130,17 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
+/* +/*
+ * register & return a new board mac address + * register & return a new board mac address
+ */ + */
+static int livebox_get_mac_address(u8 *mac) +static int livebox_get_mac_address(u8 mac[ETH_ALEN])
+{ +{
+ u8 *p; + u8 *p;
+ int count; + int count;
+ void __iomem *volatile mmio;
+ +
+ memcpy(mac, (u8 *)0xBEBFF377, ETH_ALEN); + mmio = ioremap(0x1ebff377, 0x8);
+ if (!mmio)
+ return -EIO;
+ memcpy_fromio(mac, mmio, ETH_ALEN);
+ iounmap(mmio);
+ +
+ p = mac + ETH_ALEN - 1; + p = mac + ETH_ALEN - 1;
+ count = mac_addr_used; + count = mac_addr_used;
......
...@@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support ...@@ -58,7 +58,7 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
#endif /* __BOARD_COMMON_H */ #endif /* __BOARD_COMMON_H */
--- /dev/null --- /dev/null
+++ b/arch/mips/bcm63xx/boards/board_livebox.c +++ b/arch/mips/bcm63xx/boards/board_livebox.c
@@ -0,0 +1,153 @@ @@ -0,0 +1,158 @@
+/* +/*
+ * This file is subject to the terms and conditions of the GNU General Public + * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive + * License. See the file "COPYING" in the main directory of this archive
...@@ -130,12 +130,17 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support ...@@ -130,12 +130,17 @@ Subject: [PATCH] MIPS: BCM63XX: add inventel Livebox support
+/* +/*
+ * register & return a new board mac address + * register & return a new board mac address
+ */ + */
+static int livebox_get_mac_address(u8 *mac) +static int livebox_get_mac_address(u8 mac[ETH_ALEN])
+{ +{
+ u8 *p; + u8 *p;
+ int count; + int count;
+ void __iomem *volatile mmio;
+ +
+ memcpy(mac, (u8 *)0xBEBFF377, ETH_ALEN); + mmio = ioremap(0x1ebff377, 0x8);
+ if (!mmio)
+ return -EIO;
+ memcpy_fromio(mac, mmio, ETH_ALEN);
+ iounmap(mmio);
+ +
+ p = mac + ETH_ALEN - 1; + p = mac + ETH_ALEN - 1;
+ count = mac_addr_used; + count = mac_addr_used;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment