From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756429Ab2GMFdu (ORCPT ); Fri, 13 Jul 2012 01:33:50 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:46646 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755832Ab2GMFds (ORCPT ); Fri, 13 Jul 2012 01:33:48 -0400 From: Joe Perches To: David Miller , linux-kernel@vger.kernel.org Cc: Johannes Berg , netdev@vger.kernel.org Subject: [PATCH net-next 1/8] etherdevice: Rename random_ether_addr to eth_random_addr Date: Thu, 12 Jul 2012 22:33:05 -0700 Message-Id: X-Mailer: git-send-email 1.7.8.111.gad25c.dirty In-Reply-To: <1341968967.13724.23.camel@joe2Laptop> References: <1341968967.13724.23.camel@joe2Laptop> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add some API symmetry to eth_broadcast_addr and add a #define to the old name for backward compatibility. Signed-off-by: Joe Perches --- include/linux/etherdevice.h | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 98a27cc..d426336 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -124,19 +124,21 @@ static inline bool is_valid_ether_addr(const u8 *addr) } /** - * random_ether_addr - Generate software assigned random Ethernet address + * eth_random_addr - Generate software assigned random Ethernet address * @addr: Pointer to a six-byte array containing the Ethernet address * * Generate a random Ethernet address (MAC) that is not multicast * and has the local assigned bit set. */ -static inline void random_ether_addr(u8 *addr) +static inline void eth_random_addr(u8 *addr) { - get_random_bytes (addr, ETH_ALEN); - addr [0] &= 0xfe; /* clear multicast bit */ - addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ + get_random_bytes(addr, ETH_ALEN); + addr[0] &= 0xfe; /* clear multicast bit */ + addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ } +#define random_ether_addr(addr) eth_random_addr(addr) + /** * eth_broadcast_addr - Assign broadcast address * @addr: Pointer to a six-byte array containing the Ethernet address @@ -160,7 +162,7 @@ static inline void eth_broadcast_addr(u8 *addr) static inline void eth_hw_addr_random(struct net_device *dev) { dev->addr_assign_type |= NET_ADDR_RANDOM; - random_ether_addr(dev->dev_addr); + eth_random_addr(dev->dev_addr); } /** -- 1.7.8.111.gad25c.dirty