diff options
| author | Jesse Brandeburg <jesse.brandeburg@intel.com> | 2015-08-13 18:34:03 -0700 |
|---|---|---|
| committer | Luis Henriques <luis.henriques@canonical.com> | 2015-09-30 13:20:44 +0100 |
| commit | bea65a59d8d46c8d17c2c79533b973b3f9f22340 (patch) | |
| tree | 78a669ea5d2d24a51144f52eace2667bcc4abd47 /include/linux/etherdevice.h | |
| parent | 7064447899bcd06949366078d2f6075bf2bfccfc (diff) | |
net: fix endian check warning in etherdevice.h
commit fbaff3ef859a86dc3df2128d2de9f8a6e255a967 upstream.
Sparse builds have been warning for a really long time now
that etherdevice.h has a conversion that is unsafe.
include/linux/etherdevice.h:79:32: warning: restricted __be16 degrades to integer
This code change fixes the issue and generates the exact
same assembly before/after (checked on x86_64)
Fixes: 2c722fe1c821 (etherdevice: Optimize a few is_<foo>_ether_addr functions)
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
CC: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Diffstat (limited to 'include/linux/etherdevice.h')
| -rw-r--r-- | include/linux/etherdevice.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 9c5529dc6d07..b3ef0bf12754 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -72,7 +72,7 @@ static inline bool is_link_local_ether_addr(const u8 *addr) #if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) return (((*(const u32 *)addr) ^ (*(const u32 *)b)) | - ((a[2] ^ b[2]) & m)) == 0; + (__force int)((a[2] ^ b[2]) & m)) == 0; #else return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; #endif |
