From patchwork Fri Aug 14 01:34:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Brandeburg X-Patchwork-Id: 507245 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C4D8B1401CD for ; Fri, 14 Aug 2015 11:34:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754678AbbHNBeG (ORCPT ); Thu, 13 Aug 2015 21:34:06 -0400 Received: from mga03.intel.com ([134.134.136.65]:60154 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952AbbHNBeF (ORCPT ); Thu, 13 Aug 2015 21:34:05 -0400 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 13 Aug 2015 18:34:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,674,1432623600"; d="scan'208";a="783379241" Received: from jbrandeb-hsm1.jf.intel.com ([134.134.3.89]) by fmsmga002.fm.intel.com with ESMTP; 13 Aug 2015 18:34:05 -0700 Subject: [net-next PATCH] net: fix endian check warning in etherdevice.h From: Jesse Brandeburg To: davem@davemloft.net Cc: joe@perches.com, netdev@vger.kernel.org Date: Thu, 13 Aug 2015 18:34:03 -0700 Message-ID: <20150814013403.20350.45692.stgit@jbrandeb-hsm1.jf.intel.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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