diff mbox series

[PATHv1,7/9] bcm_ns3: fix overlap define with lwip

Message ID 20231204120446.3277-8-maxim.uvarov@linaro.org
State New
Headers show
Series net fixes prior lwip | expand

Commit Message

Maxim Uvarov Dec. 4, 2023, 12:04 p.m. UTC
Rename declaration to not overlap with lwip.

aarch64:  +   bcm_ns3
+In file included from net/lwip/lwip-external/src/include/lwip/etharp.h:53,
+                 from net/lwip/lwip-external/src/core/init.c:55:
+net/lwip/lwip-external/src/include/lwip/prot/ethernet.h:69:
		  error: "ETH_ADDR" redefined [-Werror]
+   69 | #define ETH_ADDR(b0, b1, b2, b3, b4, b5) {{b0, b1, b2, b3, b4, b5}}
+      |
+In file included from include/config.h:3,
+                 from arch/arm/include/asm/string.h:4,
+                 from include/linux/string.h:21,
+                 from include/malloc.h:369,
+                 from include/stdlib.h:9,
+                 from net/lwip/lwip-external/src/include/lwip/arch.h:83,
+                 from net/lwip/lwip-external/src/include/lwip/debug.h:40,
+                 from net/lwip/lwipopts.h:93,
+                 from net/lwip/lwip-external/src/include/lwip/opt.h:51,
+                 from net/lwip/lwip-external/src/core/init.c:38:
+include/configs/bcm_ns3.h:52: note: this is the location of the previous definition
+   52 | #define ETH_ADDR

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 include/configs/bcm_ns3.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Peter Robinson Dec. 5, 2023, 9:03 a.m. UTC | #1
On Tue, Dec 5, 2023 at 8:56 AM Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> Rename declaration to not overlap with lwip.

I think the commit message can be made more generic like "Use device
specific naming for variables so as to not overlap with common
function names", I also don't think you need to include the compile
error in the commit. Code itself looks good so:

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>

> aarch64:  +   bcm_ns3
> +In file included from net/lwip/lwip-external/src/include/lwip/etharp.h:53,
> +                 from net/lwip/lwip-external/src/core/init.c:55:
> +net/lwip/lwip-external/src/include/lwip/prot/ethernet.h:69:
>                   error: "ETH_ADDR" redefined [-Werror]
> +   69 | #define ETH_ADDR(b0, b1, b2, b3, b4, b5) {{b0, b1, b2, b3, b4, b5}}
> +      |
> +In file included from include/config.h:3,
> +                 from arch/arm/include/asm/string.h:4,
> +                 from include/linux/string.h:21,
> +                 from include/malloc.h:369,
> +                 from include/stdlib.h:9,
> +                 from net/lwip/lwip-external/src/include/lwip/arch.h:83,
> +                 from net/lwip/lwip-external/src/include/lwip/debug.h:40,
> +                 from net/lwip/lwipopts.h:93,
> +                 from net/lwip/lwip-external/src/include/lwip/opt.h:51,
> +                 from net/lwip/lwip-external/src/core/init.c:38:
> +include/configs/bcm_ns3.h:52: note: this is the location of the previous definition
> +   52 | #define ETH_ADDR
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
>  include/configs/bcm_ns3.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/include/configs/bcm_ns3.h b/include/configs/bcm_ns3.h
> index 47de4bc201..7c6e0725a6 100644
> --- a/include/configs/bcm_ns3.h
> +++ b/include/configs/bcm_ns3.h
> @@ -45,11 +45,11 @@
>  #define PCIE_ARGS "pcie_args=pci=pcie_bus_safe pcie_ports=native vfio_pci.disable_idle_d3=1\0"
>
>  #ifdef CONFIG_BCM_SF2_ETH
> -#define ETH_ADDR "ethaddr=00:0A:F7:95:65:A4\0"
> +#define BCM_ETH_ADDR "ethaddr=00:0A:F7:95:65:A4\0"
>  #define NET_ARGS "bgmac_platform.ethaddr=${ethaddr} " \
>         "ip=${ipaddr}::${gatewayip}:${netmask}::${ethif}:off"
>  #else
> -#define ETH_ADDR
> +#define BMC_ETH_ADDR
>  #define NET_ARGS
>  #endif
>
> @@ -749,7 +749,7 @@
>         OS_LOG_LEVEL \
>         EXTRA_ARGS \
>         PCIE_ARGS \
> -       ETH_ADDR \
> +       BMC_ETH_ADDR \
>         RESERVED_MEM \
>         SETBOOTARGS \
>         UPDATEME_FLASH_PARAMS \
> --
> 2.30.2
>
diff mbox series

Patch

diff --git a/include/configs/bcm_ns3.h b/include/configs/bcm_ns3.h
index 47de4bc201..7c6e0725a6 100644
--- a/include/configs/bcm_ns3.h
+++ b/include/configs/bcm_ns3.h
@@ -45,11 +45,11 @@ 
 #define PCIE_ARGS "pcie_args=pci=pcie_bus_safe pcie_ports=native vfio_pci.disable_idle_d3=1\0"
 
 #ifdef CONFIG_BCM_SF2_ETH
-#define ETH_ADDR "ethaddr=00:0A:F7:95:65:A4\0"
+#define BCM_ETH_ADDR "ethaddr=00:0A:F7:95:65:A4\0"
 #define NET_ARGS "bgmac_platform.ethaddr=${ethaddr} " \
 	"ip=${ipaddr}::${gatewayip}:${netmask}::${ethif}:off"
 #else
-#define ETH_ADDR
+#define BMC_ETH_ADDR
 #define NET_ARGS
 #endif
 
@@ -749,7 +749,7 @@ 
 	OS_LOG_LEVEL \
 	EXTRA_ARGS \
 	PCIE_ARGS \
-	ETH_ADDR \
+	BMC_ETH_ADDR \
 	RESERVED_MEM \
 	SETBOOTARGS \
 	UPDATEME_FLASH_PARAMS \