From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtprelay0080.hostedemail.com ([216.40.44.80]:35318 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751186AbeCTUZS (ORCPT ); Tue, 20 Mar 2018 16:25:18 -0400 Message-ID: <1521577515.12047.24.camel@perches.com> Subject: Re: rfc: treewide replace local ethernet broadcast char arrays with a global ? From: Joe Perches To: Florian Fainelli , netdev Date: Tue, 20 Mar 2018 13:25:15 -0700 In-Reply-To: References: <1521576009.12047.17.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org List-ID: 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 ?