From: Ozan Çağlayan Date: Wed, 16 May 2012 09:55:48 +0000 (+0300) Subject: compat: backport ether_addr_equal X-Git-Tag: compat-2012-07-02~1^2~13 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=15e897766369c32f4787d1e21be0dd682b614f46;p=~emulex%2Ftmp%2Fcompat%2F.git compat: backport ether_addr_equal This backports: commit a599b0f54d233d0f63d6be9a2ff0049d24751669 Author: Joe Perches Date: Tue May 8 18:56:45 2012 +0000 etherdevice.h: Add ether_addr_equal Add a boolean function to check if 2 ethernet addresses are the same. This is to avoid any confusion about compare_ether_addr returning an unsigned, and not being able to use the compare_ether_addr function for sorting ala memcmp. Signed-off-by: Joe Perches Signed-off-by: David S. Miller [root@ozzyfedora compat]# bin/ckmake Trying kernel 3.3.4-5.fc17.x86_64 [OK] mcgrof@tux ~/compat (git::master)$ ckmake Trying kernel 3.4.0-030400rc1-generic [OK] Trying kernel 3.3.0-030300rc2-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] Tested-by: Luis R. Rodriguez Signed-off-by: Ozan Çağlayan Signed-off-by: Luis R. Rodriguez --- diff --git a/include/linux/compat-3.5.h b/include/linux/compat-3.5.h index 554d347..a83266b 100644 --- a/include/linux/compat-3.5.h +++ b/include/linux/compat-3.5.h @@ -3,6 +3,7 @@ #include #include +#include #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) @@ -12,6 +13,12 @@ extern int simple_open(struct inode *inode, struct file *file); #define tty_lock(__tty) tty_lock() #define tty_unlock(__tty) tty_unlock() +/* Backport ether_addr_equal */ +static inline bool ether_addr_equal(const u8 *addr1, const u8 *addr2) +{ + return !compare_ether_addr(addr1, addr2); +} + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */ #endif /* LINUX_3_5_COMPAT_H */