netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] etherdevice: introduce broadcast_ether_addr
@ 2012-07-03 10:16 Johannes Berg
  2012-07-03 15:13 ` Joe Perches
       [not found] ` <1341310587.5131.2.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
  0 siblings, 2 replies; 23+ messages in thread
From: Johannes Berg @ 2012-07-03 10:16 UTC (permalink / raw)
  To: netdev; +Cc: linux-wireless

From: Johannes Berg <johannes.berg@intel.com>

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.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 include/linux/etherdevice.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 3d406e0..6da05bb 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -138,6 +138,17 @@ static inline void random_ether_addr(u8 *addr)
 }
 
 /**
+ * broadcast_ether_addr - Assign broadcast address
+ * @addr: Pointer to a six-byte array containing the Ethernet address
+ *
+ * Assign the broadcast address to the given address array.
+ */
+static inline void broadcast_ether_addr(u8 *addr)
+{
+	memset(addr, 0xff, ETH_ALEN);
+}
+
+/**
  * eth_hw_addr_random - Generate software assigned random Ethernet and
  * set device flag
  * @dev: pointer to net_device structure
-- 
1.7.10

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

end of thread, other threads:[~2012-07-17  5:39 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-03 10:16 [PATCH] etherdevice: introduce broadcast_ether_addr Johannes Berg
2012-07-03 15:13 ` Joe Perches
2012-07-03 15:16   ` Johannes Berg
     [not found] ` <1341310587.5131.2.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2012-07-09  6:58   ` David Miller
2012-07-10 16:18     ` [PATCH] etherdevice: introduce eth_broadcast_addr Johannes Berg
2012-07-11  0:09       ` Paul Gortmaker
2012-07-11  0:41         ` David Miller
     [not found]           ` <20120710.174142.995966539991957646.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-07-11  1:09             ` Joe Perches
2012-07-13  5:33               ` [PATCH net-next 0/8] etherdevice: Rename random_ether_addr to eth_random_addr Joe Perches
2012-07-13  5:33                 ` [PATCH net-next 1/8] " Joe Perches
2012-07-13  5:33                 ` [PATCH net-next 2/8] ethernet: Use eth_random_addr Joe Perches
2012-07-13  5:33                 ` [PATCH net-next 3/8] net: usb: " Joe Perches
2012-07-13  5:33                 ` [PATCH net-next 4/8] wireless: " Joe Perches
2012-07-13  5:54                   ` Hin-Tak Leung
     [not found]                   ` <93ab9a323e85d1b0d8c7eac4db7ab7835e61efe6.1342157022.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2012-07-13  7:15                     ` Gertjan van Wingerde
2012-07-13  5:33                 ` [PATCH net-next 5/8] drivers/net: " Joe Perches
     [not found]                 ` <cover.1342157022.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2012-07-16 10:14                   ` [PATCH net-next 0/8] etherdevice: Rename random_ether_addr to eth_random_addr Felipe Balbi
2012-07-16 10:29                     ` David Miller
2012-07-16 11:12                       ` Felipe Balbi
     [not found]                         ` <20120716111218.GA4913-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2012-07-16 11:17                           ` David Miller
2012-07-17  5:39                   ` David Miller
     [not found]         ` <CAP=VYLqNyAF1gSsKTd3YojeJXK_-pEzXAKyVQbQfwhtwOyMmwg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-07-11  7:27           ` [PATCH] etherdevice: introduce eth_broadcast_addr Johannes Berg
2012-07-11  1:07       ` 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).