From: "Bjørn Mork" <bjorn@mork.no>
To: Joe Perches <joe@perches.com>
Cc: David Miller <davem@davemloft.net>,
netdev@vger.kernel.org, sowmini.varadhan@oracle.com
Subject: Re: [PATCH v2] net: Add eth_platform_get_mac_address() helper.
Date: Thu, 07 Jan 2016 00:41:29 +0100 [thread overview]
Message-ID: <87r3hub7iu.fsf@nemi.mork.no> (raw)
In-Reply-To: <1452123144.24575.57.camel@perches.com> (Joe Perches's message of "Wed, 06 Jan 2016 15:32:24 -0800")
Joe Perches <joe@perches.com> writes:
> On Thu, 2016-01-07 at 00:26 +0100, Bjørn Mork wrote:
>> Joe Perches <joe@perches.com> writes:
>> > On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
>> > > A repeating pattern in drivers has become to use OF node information
>> > > and, if not found, platform specific host information to extract the
>> > > ethernet address for a given device.
>> > []
>> > > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
>> > []
>> > > @@ -485,3 +487,32 @@ static int __init eth_offload_init(void)
>> > > }
>> > >
>> > > fs_initcall(eth_offload_init);
>> > > +
>> > > +unsigned char * __weak arch_get_platform_mac_address(void)
>> > > +{
>> > > + return NULL;
>> >
>> > WARN_ON_ONCE ?
>>
>> That would prevent a driver from using this with additional fallback
>> methods. For what reason?
>
> It's declared __weak and should be overridden by
> an arch specific function.
"should"? Why? Do you have a suggested implementation for - say - x86?
> A NULL address would cause a fault when using
> a function like copy_ether_addr.
You should not do that then :)
Bjørn
next prev parent reply other threads:[~2016-01-06 23:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 21:33 [PATCH v2] net: Add eth_platform_get_mac_address() helper David Miller
2016-01-06 21:45 ` Sowmini Varadhan
2016-01-06 23:12 ` Joe Perches
2016-01-06 23:26 ` Bjørn Mork
2016-01-06 23:32 ` Joe Perches
2016-01-06 23:41 ` Bjørn Mork [this message]
2016-01-07 0:01 ` David Miller
2016-01-07 0:02 ` Joe Perches
2016-01-13 0:49 ` Sowmini Varadhan
2016-01-13 0:59 ` Kirsher, Jeffrey T
2016-01-13 2:40 ` David Miller
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=87r3hub7iu.fsf@nemi.mork.no \
--to=bjorn@mork.no \
--cc=davem@davemloft.net \
--cc=joe@perches.com \
--cc=netdev@vger.kernel.org \
--cc=sowmini.varadhan@oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).