From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com ([91.189.89.112]:46686 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932413AbbI3JyP (ORCPT ); Wed, 30 Sep 2015 05:54:15 -0400 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Jesse Brandeburg , Joe Perches , "David S. Miller" , Luis Henriques Subject: [PATCH 3.16.y-ckt 103/133] net: fix endian check warning in etherdevice.h Date: Wed, 30 Sep 2015 10:50:51 +0100 Message-Id: <1443606681-7124-104-git-send-email-luis.henriques@canonical.com> In-Reply-To: <1443606681-7124-1-git-send-email-luis.henriques@canonical.com> References: <1443606681-7124-1-git-send-email-luis.henriques@canonical.com> Sender: stable-owner@vger.kernel.org List-ID: 3.16.7-ckt18 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Jesse Brandeburg 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__ether_addr functions) Signed-off-by: Jesse Brandeburg CC: Joe Perches Signed-off-by: David S. Miller Signed-off-by: Luis Henriques --- 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 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