Return-path: Received: from he.sipsolutions.net ([78.46.109.217]:38478 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933032Ab2GCPQ4 (ORCPT ); Tue, 3 Jul 2012 11:16:56 -0400 Message-ID: <1341328615.20124.5.camel@jlt3.sipsolutions.net> (sfid-20120703_171713_653810_310F38FD) Subject: Re: [PATCH] etherdevice: introduce broadcast_ether_addr From: Johannes Berg To: Joe Perches Cc: netdev , linux-wireless Date: Tue, 03 Jul 2012 17:16:55 +0200 In-Reply-To: <1341328402.2164.3.camel@joe2Laptop> References: <1341310587.5131.2.camel@jlt3.sipsolutions.net> <1341328402.2164.3.camel@joe2Laptop> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 2012-07-03 at 08:13 -0700, Joe Perches wrote: > On Tue, 2012-07-03 at 12:16 +0200, Johannes Berg wrote: > > From: Johannes Berg > > > > A lot of code has either the memset or an > > inefficient copy from a static array that > > contains the all-ones broadcast address. > > Introduce broadcast_ether_addr() to fill > > an address with all ones, making the code > > clearer and allowing us to get rid of the > > various constant arrays. > [] > > diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h > [] > > +static inline void broadcast_ether_addr(u8 *addr) > > +{ > > + memset(addr, 0xff, ETH_ALEN); > > +} > > I think this sort of patch should come as the first > patch in a series with some example conversions. > > It might be too easy to confuse is_broadcast_ether_addr > with this function name too. Maybe set_broadcast_ether_addr > might be better. Well, it's void so that'd be a compiler error :-) Also, it's more like random_ether_addr() johannes