From: Jakub Kicinski <kuba@kernel.org>
To: Atharva Tiwari <atharvatiwarilinuxdev@gmail.com>
Cc: Rishon Jonathan R <mithicalaviator85@gmail.com>,
Vincent MORVAN <vinc@42.fr>, Paul SAGE <paul.sage@42.fr>,
Pavan Chebbi <pavan.chebbi@broadcom.com>,
Michael Chan <mchan@broadcom.com>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] tg3: replace placeholder MAC address with device property
Date: Sat, 14 Mar 2026 09:38:47 -0700 [thread overview]
Message-ID: <20260314093847.4904d26f@kernel.org> (raw)
In-Reply-To: <20260313060810.1314-1-atharvatiwarilinuxdev@gmail.com>
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
prev parent reply other threads:[~2026-03-14 16:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-13 6:08 [PATCH v3] tg3: replace placeholder MAC address with device property Atharva Tiwari
2026-03-14 16:38 ` Jakub Kicinski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260314093847.4904d26f@kernel.org \
--to=kuba@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=atharvatiwarilinuxdev@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mchan@broadcom.com \
--cc=mithicalaviator85@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paul.sage@42.fr \
--cc=pavan.chebbi@broadcom.com \
--cc=vinc@42.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.