Subject: Re: [PATCH v3] tg3: replace placeholder MAC address with device property

From: Jakub Kicinski <[email-masked]>
Date: Sat, 14 Mar 2026 09:38:47 -0700

On Fri, 13 Mar 2026 11:38:09 +0530 Atharva Tiwari wrote:
> +static int tg3_is_default_mac_address(u8 *addr)
> +{
> +	const u8 default_mac_address[ETH_ALEN] = { 0x00, 0x10, 0x18, 0x00, 0x00, 0x00 };

Please add static as well. I think it should result in slightly smaller
object code.

> +	return ether_addr_equal(default_mac_address, addr);
> +}
> +
>  static int tg3_get_device_address(struct tg3 *tp, u8 *addr)
>  {
>  	u32 hi, lo, mac_offset;
> @@ -17103,6 +17110,10 @@ static int tg3_get_device_address(struct tg3 *tp, u8 *addr)
>  
>  	if (!is_valid_ether_addr(addr))
>  		return -EINVAL;
> +
> +	if (tg3_is_default_mac_address(addr))
> +		device_get_mac_address(&tp->pdev->dev, addr);

Shouldn't we return device_get_mac_address(); IOW return an error if
device_get.. failed?
-- 
pw-bot: cr