From: Ozan Çağlayan Date: Thu, 23 Aug 2012 11:37:27 +0000 (+0300) Subject: compat: Backport eth_broadcast_addr() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=99d7ff910e3c38efadacbc6506cd898afcbf9b4e;p=openwrt%2Fstaging%2Fblogic.git compat: Backport eth_broadcast_addr() This backports: commit ad7eee98bef92481581060801bdfd1b25a6106c0 Author: Johannes Berg Commit: David S. Miller etherdevice: introduce eth_broadcast_addr A lot of code has either the memset or an inefficient copy from a static array that contains the all-ones broadcast address. Introduce eth_broadcast_addr() to fill an address with all ones, making the code clearer and allowing us to get rid of some constant arrays. Signed-off-by: Johannes Berg Signed-off-by: David S. Miller $ git describe --contains ad7eee98bef92481581060801bdfd1b25a6106c0 v3.6-rc1~125^2~252 Trying kernel 3.5.0-030500-generic [OK] Trying kernel 3.4.4-030404-generic [OK] Trying kernel 3.3.7-030307-generic [OK] Trying kernel 3.2.2-030202-generic [OK] Trying kernel 3.1.10-030110-generic [OK] Trying kernel 3.0.18-030018-generic [OK] Trying kernel 2.6.39-02063904-generic [OK] Trying kernel 2.6.38-02063808-generic [OK] Trying kernel 2.6.37-02063706-generic [OK] Trying kernel 2.6.36-02063604-generic [OK] Trying kernel 2.6.35-02063512-generic [OK] Trying kernel 2.6.34-02063410-generic [OK] Trying kernel 2.6.33-02063305-generic [OK] Trying kernel 2.6.32-02063255-generic [OK] Trying kernel 2.6.31-02063113-generic [OK] Trying kernel 2.6.30-02063010-generic [OK] Trying kernel 2.6.29-02062906-generic [OK] Trying kernel 2.6.28-02062810-generic [OK] Trying kernel 2.6.27-020627-generic [OK] Trying kernel 2.6.26-020626-generic [OK] Trying kernel 2.6.25-020625-generic [OK] Trying kernel 2.6.24-020624-generic [OK] Signed-off-by: Ozan Çağlayan Signed-off-by: Luis R. Rodriguez --- diff --git a/include/linux/compat-3.6.h b/include/linux/compat-3.6.h index 63753cde564d..97b59933f53a 100644 --- a/include/linux/compat-3.6.h +++ b/include/linux/compat-3.6.h @@ -47,6 +47,17 @@ #include #include +/** + * eth_broadcast_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 eth_broadcast_addr(u8 *addr) +{ + memset(addr, 0xff, ETH_ALEN); +} + /** * eth_random_addr - Generate software assigned random Ethernet address * @addr: Pointer to a six-byte array containing the Ethernet address