[PATCH 17/17] global: Cleanup usage of "ETH_ALEN"
Tom Rini
trini at konsulko.com
Thu May 22 00:51:22 CEST 2025
The value of "ETH_ALEN" is defined to 6 in <linux/if_ether.h>. This file
is included in <net.h>. In the places where we had ETH_ALEN but no
direct include of <net.h>, add <linux/if_ether.h>. In the places where
we had a custom name used, make use of ETH_ALEN instead.
Signed-off-by: Tom Rini <trini at konsulko.com>
---
arch/arm/mach-tegra/dt-setup.c | 1 +
board/CZ.NIC/turris_omnia/turris_omnia.c | 1 +
board/Marvell/mvebu_armada-37xx/board.c | 1 +
board/Synology/common/legacy.h | 2 ++
board/bosch/shc/board.h | 5 +++--
board/ti/common/board_detect.h | 4 +++-
drivers/net/mscc_eswitch/jr2_switch.c | 1 -
drivers/net/mscc_eswitch/luton_switch.c | 1 -
drivers/net/mscc_eswitch/ocelot_switch.c | 1 -
drivers/net/mscc_eswitch/serval_switch.c | 1 -
drivers/net/mscc_eswitch/servalt_switch.c | 1 -
drivers/virtio/virtio_net.h | 3 +--
12 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-tegra/dt-setup.c b/arch/arm/mach-tegra/dt-setup.c
index f4ae602d5239..7f1c3538ebeb 100644
--- a/arch/arm/mach-tegra/dt-setup.c
+++ b/arch/arm/mach-tegra/dt-setup.c
@@ -5,6 +5,7 @@
#include <fdtdec.h>
#include <stdlib.h>
+#include <linux/if_ether.h>
#include <asm/arch-tegra/cboot.h>
#include <asm/arch-tegra/gpu.h>
diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c
index b7588fa4eec9..baee5afa46d2 100644
--- a/board/CZ.NIC/turris_omnia/turris_omnia.c
+++ b/board/CZ.NIC/turris_omnia/turris_omnia.c
@@ -29,6 +29,7 @@
#include <linux/bitops.h>
#include <linux/bitrev.h>
#include <linux/delay.h>
+#include <linux/if_ether.h>
#include <u-boot/crc.h>
#include "../drivers/ddr/marvell/a38x/ddr3_init.h"
diff --git a/board/Marvell/mvebu_armada-37xx/board.c b/board/Marvell/mvebu_armada-37xx/board.c
index df3fb6d21645..e44b713f96d7 100644
--- a/board/Marvell/mvebu_armada-37xx/board.c
+++ b/board/Marvell/mvebu_armada-37xx/board.c
@@ -20,6 +20,7 @@
#include <asm/arch/cpu.h>
#include <asm/arch/soc.h>
#include <linux/delay.h>
+#include <linux/if_ether.h>
DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/Synology/common/legacy.h b/board/Synology/common/legacy.h
index 0a814324d097..f7ba225bd2ba 100644
--- a/board/Synology/common/legacy.h
+++ b/board/Synology/common/legacy.h
@@ -8,6 +8,8 @@
#ifndef __SYNO_LEGACY_H
#define __SYNO_LEGACY_H
+#include <linux/if_ether.h>
+
/* Marvell uboot parameters */
#define ATAG_MV_UBOOT 0x41000403
#define VER_NUM 0x03040400 /* 3.4.4 */
diff --git a/board/bosch/shc/board.h b/board/bosch/shc/board.h
index a5e58186c9c1..8ff68f5a64b9 100644
--- a/board/bosch/shc/board.h
+++ b/board/bosch/shc/board.h
@@ -14,6 +14,8 @@
#ifndef _BOARD_H_
#define _BOARD_H_
+#include <linux/if_ether.h>
+
/* Definition to control the GPIOs (for LEDs and Reset) */
#define GPIO_TO_PIN(bank, gpio) (32 * (bank) + (gpio))
@@ -146,7 +148,6 @@ static inline int board_is_series(void)
#define RESET_MASK (0x1 << 29)
#define HDR_MAGIC 0x43485342
-#define HDR_ETH_ALEN 6
#define HDR_NAME_LEN 8
#define HDR_REV_LEN 8
#define HDR_SER_LEN 16
@@ -176,7 +177,7 @@ struct shc_eeprom {
u32 magic;
u16 version;
u16 lenght;
- uint8_t mac_addr[HDR_ETH_ALEN];
+ uint8_t mac_addr[ETH_ALEN];
};
void enable_uart0_pin_mux(void);
diff --git a/board/ti/common/board_detect.h b/board/ti/common/board_detect.h
index ca1aa80f2f04..b057f3b2269b 100644
--- a/board/ti/common/board_detect.h
+++ b/board/ti/common/board_detect.h
@@ -10,6 +10,8 @@
/* TI EEPROM MAGIC Header identifier */
#include <linux/bitops.h>
+#include <linux/if_ether.h>
+
#define TI_EEPROM_HEADER_MAGIC 0xEE3355AA
#define TI_DEAD_EEPROM_MAGIC 0xADEAD12C
@@ -18,7 +20,7 @@
#define TI_EEPROM_HDR_SERIAL_LEN 12
#define TI_EEPROM_HDR_CONFIG_LEN 32
#define TI_EEPROM_HDR_NO_OF_MAC_ADDR 3
-#define TI_EEPROM_HDR_ETH_ALEN 6
+#define TI_EEPROM_HDR_ETH_ALEN ETH_ALEN
/**
* struct ti_am_eeprom - This structure holds data read in from the
diff --git a/drivers/net/mscc_eswitch/jr2_switch.c b/drivers/net/mscc_eswitch/jr2_switch.c
index 925888e0765a..f04042091163 100644
--- a/drivers/net/mscc_eswitch/jr2_switch.c
+++ b/drivers/net/mscc_eswitch/jr2_switch.c
@@ -222,7 +222,6 @@
#define CPU_PORT 53
#define IFH_LEN 7
#define JR2_BUF_CELL_SZ 60
-#define ETH_ALEN 6
#define PGID_BROADCAST 510
#define PGID_UNICAST 511
diff --git a/drivers/net/mscc_eswitch/luton_switch.c b/drivers/net/mscc_eswitch/luton_switch.c
index 1c584373b8bc..be78afc3f794 100644
--- a/drivers/net/mscc_eswitch/luton_switch.c
+++ b/drivers/net/mscc_eswitch/luton_switch.c
@@ -132,7 +132,6 @@
#define CPU_PORT 26
#define INTERNAL_PORT_MSK 0xFFFFFF
#define IFH_LEN 2
-#define ETH_ALEN 6
#define PGID_BROADCAST 28
#define PGID_UNICAST 29
#define PGID_SRC 80
diff --git a/drivers/net/mscc_eswitch/ocelot_switch.c b/drivers/net/mscc_eswitch/ocelot_switch.c
index 30bb4b5bad8b..b7a8b60587df 100644
--- a/drivers/net/mscc_eswitch/ocelot_switch.c
+++ b/drivers/net/mscc_eswitch/ocelot_switch.c
@@ -126,7 +126,6 @@
#define CPU_PORT 11
#define INTERNAL_PORT_MSK 0x2FF
#define IFH_LEN 4
-#define ETH_ALEN 6
#define PGID_BROADCAST 13
#define PGID_UNICAST 14
#define PGID_SRC 80
diff --git a/drivers/net/mscc_eswitch/serval_switch.c b/drivers/net/mscc_eswitch/serval_switch.c
index 8eab41df99ae..02f197aa3398 100644
--- a/drivers/net/mscc_eswitch/serval_switch.c
+++ b/drivers/net/mscc_eswitch/serval_switch.c
@@ -111,7 +111,6 @@
#define CPU_PORT 11
#define INTERNAL_PORT_MSK 0xFF
#define IFH_LEN 4
-#define ETH_ALEN 6
#define PGID_BROADCAST 13
#define PGID_UNICAST 14
diff --git a/drivers/net/mscc_eswitch/servalt_switch.c b/drivers/net/mscc_eswitch/servalt_switch.c
index 61547d7933e4..4b073c0781ef 100644
--- a/drivers/net/mscc_eswitch/servalt_switch.c
+++ b/drivers/net/mscc_eswitch/servalt_switch.c
@@ -88,7 +88,6 @@
#define MAC_VID 0
#define CPU_PORT 11
#define IFH_LEN 7
-#define ETH_ALEN 6
#define PGID_BROADCAST 50
#define PGID_UNICAST 51
diff --git a/drivers/virtio/virtio_net.h b/drivers/virtio/virtio_net.h
index c92bae526906..3adcb19aead2 100644
--- a/drivers/virtio/virtio_net.h
+++ b/drivers/virtio/virtio_net.h
@@ -9,8 +9,7 @@
#ifndef _LINUX_VIRTIO_NET_H
#define _LINUX_VIRTIO_NET_H
-/* TODO: needs to be removed! */
-#define ETH_ALEN 6
+#include <linux/if_ether.h>
/* The feature bitmap for virtio net */
--
2.43.0
More information about the U-Boot
mailing list