diff mbox series

[04/19] firmware: turris-mox-rwtm: Use ETH_ALEN instead of hardcoded 6

Message ID 20240612135443.30239-5-kabel@kernel.org (mailing list archive)
State Superseded
Headers show
Series Updates for turris-mox-rwtm driver | expand

Commit Message

Marek Behún June 12, 2024, 1:54 p.m. UTC
Use the ETH_ALEN macro instead of hardcoded 6 for MAC address length.

Signed-off-by: Marek Behún <kabel@kernel.org>
---
 drivers/firmware/turris-mox-rwtm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ilpo Järvinen June 13, 2024, 8:02 a.m. UTC | #1
On Wed, 12 Jun 2024, Marek Behún wrote:

> Use the ETH_ALEN macro instead of hardcoded 6 for MAC address length.
> 
> Signed-off-by: Marek Behún <kabel@kernel.org>
> ---
>  drivers/firmware/turris-mox-rwtm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
> index 5acdde1bb6d9..1b708a0760e6 100644
> --- a/drivers/firmware/turris-mox-rwtm.c
> +++ b/drivers/firmware/turris-mox-rwtm.c
> @@ -10,6 +10,7 @@
>  #include <linux/debugfs.h>
>  #include <linux/dma-mapping.h>
>  #include <linux/hw_random.h>
> +#include <linux/if_ether.h>
>  #include <linux/mailbox_client.h>
>  #include <linux/module.h>
>  #include <linux/mutex.h>
> @@ -65,7 +66,7 @@ struct mox_rwtm {
>  	int has_board_info;
>  	u64 serial_number;
>  	int board_version, ram_size;
> -	u8 mac_address1[6], mac_address2[6];
> +	u8 mac_address1[ETH_ALEN], mac_address2[ETH_ALEN];

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
diff mbox series

Patch

diff --git a/drivers/firmware/turris-mox-rwtm.c b/drivers/firmware/turris-mox-rwtm.c
index 5acdde1bb6d9..1b708a0760e6 100644
--- a/drivers/firmware/turris-mox-rwtm.c
+++ b/drivers/firmware/turris-mox-rwtm.c
@@ -10,6 +10,7 @@ 
 #include <linux/debugfs.h>
 #include <linux/dma-mapping.h>
 #include <linux/hw_random.h>
+#include <linux/if_ether.h>
 #include <linux/mailbox_client.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
@@ -65,7 +66,7 @@  struct mox_rwtm {
 	int has_board_info;
 	u64 serial_number;
 	int board_version, ram_size;
-	u8 mac_address1[6], mac_address2[6];
+	u8 mac_address1[ETH_ALEN], mac_address2[ETH_ALEN];
 
 	/* public key burned in eFuse */
 	int has_pubkey;