Re: [net-next PATCH] net: fix endian check warning in etherdevice.h

2015-08-17 Thread David Miller
From: Jesse Brandeburg 
Date: Thu, 13 Aug 2015 18:34:03 -0700

> 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__ether_addr 
> functions)
> Signed-off-by: Jesse Brandeburg 

Applied, thanks Jesse.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[net-next PATCH] net: fix endian check warning in etherdevice.h

2015-08-13 Thread Jesse Brandeburg
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__ether_addr functions)
Signed-off-by: Jesse Brandeburg 
CC: Joe Perches 
---
 include/linux/etherdevice.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 9012f87..eb049c6 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -76,7 +76,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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html