public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches•com>
To: Florian Fainelli <f.fainelli@gmail•com>, netdev <netdev@vger•kernel.org>
Subject: Re: rfc: treewide replace local ethernet broadcast char arrays with a global ?
Date: Tue, 20 Mar 2018 13:25:15 -0700	[thread overview]
Message-ID: <1521577515.12047.24.camel@perches.com> (raw)
In-Reply-To: <bd247d15-4b10-3a57-16fe-7ba6908e8bfe@gmail.com>

On Tue, 2018-03-20 at 13:07 -0700, Florian Fainelli wrote:
> On 03/20/2018 01:00 PM, Joe Perches wrote:
> > Treewide there are ~60 declarations of a ethernet broadcast
> > address as a 6 byte array that are later used as either an
> > output for vsprintf extension %pM or as a source array to
> > copy or compare.
> > 
> > Perhaps it'd be useful to declare a global static const u8[]
> > in net somewhere instead to save the text/data space of these
> > duplicate declarations.
> 
> I could have sworn that such a thing existed already within
> include/linux/etherdevice.h but it is only eth_reserved_addr_base and
> friends as well as is_broadcast_ether_addr(). How about you do it?

I hadn't noticed eth_reserved_addr_base before and it does
seem incorrectly specified as static definitions in .h
files for what should be extern are odd.

Real question is, if the global ethernet broadcast address
array is deemed useful, where to put the definition.  The
extern declaration should definitely be in etherdevice.h

Maybe net/ethernet/eth.c ?

  reply	other threads:[~2018-03-20 20:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 20:00 rfc: treewide replace local ethernet broadcast char arrays with a global ? Joe Perches
2018-03-20 20:07 ` Florian Fainelli
2018-03-20 20:25   ` Joe Perches [this message]
2018-03-21  9:03   ` [RFC PATCH] etherdevice.h: net/core: Add ether_addrs.c and global ether_<foo>_addr Joe Perches
2018-03-22 18:33     ` 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=1521577515.12047.24.camel@perches.com \
    --to=joe@perches$(echo .)com \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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