All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Bjørn Mork" <bjorn@mork.no>
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: Wed, 06 Jan 2016 15:32:24 -0800	[thread overview]
Message-ID: <1452123144.24575.57.camel@perches.com> (raw)
In-Reply-To: <87vb76b87m.fsf@nemi.mork.no>

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.

A NULL address would cause a fault when using
a function like copy_ether_addr.


> I don't have a specific usecase, but I can imagine drivers falling back
> to e.g a random address without wanting to be noisy about it.

  reply	other threads:[~2016-01-06 23:32 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 [this message]
2016-01-06 23:41       ` Bjørn Mork
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=1452123144.24575.57.camel@perches.com \
    --to=joe@perches.com \
    --cc=bjorn@mork.no \
    --cc=davem@davemloft.net \
    --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 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.