netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rfc: treewide replace local ethernet broadcast char arrays with a global ?
@ 2018-03-20 20:00 Joe Perches
  2018-03-20 20:07 ` Florian Fainelli
  0 siblings, 1 reply; 5+ messages in thread
From: Joe Perches @ 2018-03-20 20:00 UTC (permalink / raw)
  To: netdev

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.

$ grep-2.5.4 -n --include=*.[ch] "\b(?:static\s+)?(?:const\s+)?(?:char|unsigned\s+char|u8)\s+\w+\s*\[\s*(?:ETH_ALEN|6)\s*\]\s*=\s*\{\s*(?:(?i:0xff|255),\s*){5,5}\s*(?i:0xff|255)\s*\}" * | \
  grep -P "\.[ch]:\d+:"

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-03-22 18:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).