Message ID | 20170714093021.1341005-1-arnd@arndb.de |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp652457qge; Fri, 14 Jul 2017 02:31:13 -0700 (PDT) X-Received: by 10.84.224.200 with SMTP id k8mr14948437pln.215.1500024673332; Fri, 14 Jul 2017 02:31:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024673; cv=none; d=google.com; s=arc-20160816; b=AtMjxtgGF5J9h26AmixPayfGol/BAdV9XR6aDBs3Co2eVJ5dKA+pWLVCdpBG0gCdGR 2XIziloJtEWQqKiwsPPmzeaWDn86DvJ+v21JmshacmNbz0WpHG0bzSgXuO8gE/RqOO/U xxXS1kSgqJFZknoTCON65K2x4bg8mvKCZuqtt7rPsV+GzP8urKUfGt+eGMIg7it/WNub OyNzjgf5LpFaplF7Ni++RMNIIv6mlK49qZiuNS185/74y7tahbQVYAfxL2jklvDiQRU6 ibQe2e5ecbtsE8+Yt92tbfrlfYGciYfq8L20QxKe13m28aa0nN56QFGlvPJNafBbWLzL ECGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:cc :mime-version:references:in-reply-to:message-id:date:subject:to:from :delivered-to:arc-authentication-results; bh=WQ4ANPO4r+YFsiyX+fkF5XlxfJoiDY96lPZD6T1xPeM=; b=p/gR6xpN2FEtRPViuddVEoxtRACKVpun/zAc6o9e6wY/NxPmn084bHBLRUiWvODMMt ZKHF7fK3QfqK4BTQQ0CXwe07zRMZBArgZGtlcIyVklM0kdAabeR8et8f2r5vclVP8xIT JskuLp5d8gWgq/jW52/yaaV5k8vtSTwxR2r7+FFKMSwOvT7VagwEUyz0ziyHqYHX6hUI 5Sg4nversNZDrnK2omCDdoZpncLubo59tI6t/7/B1KHqbuixPoAu3TBWcazoMv4SDoPf 3lB2Fv5pdhUBfOeeSH4jo/m00jPS4nzRBENT+dnl9aV0SUxsz+K7KvBybf1cQ/ZHgHO4 kbBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: <dri-devel-bounces@lists.freedesktop.org> Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id g13si6600559plm.355.2017.07.14.02.31.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:31:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5A3846E7AC; Fri, 14 Jul 2017 09:31:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id 18E7C6E7AC for <dri-devel@lists.freedesktop.org>; Fri, 14 Jul 2017 09:31:09 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue004 [212.227.15.129]) with ESMTPA (Nemesis) id 0Lgc09-1e220j1ULl-00nuxO; Fri, 14 Jul 2017 11:30:24 +0200 From: Arnd Bergmann <arnd@arndb.de> To: linux-kernel@vger.kernel.org, Len Brown <lenb@kernel.org> Subject: [PATCH 09/14] SFI: fix tautological-compare warning Date: Fri, 14 Jul 2017 11:30:12 +0200 Message-Id: <20170714093021.1341005-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20170714092540.1217397-1-arnd@arndb.de> References: <20170714092540.1217397-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:hd1nKn8Ni74HjCk1caFaj/ZCREhsjc/sH301HkaxXRLP1WjuJwr pE7pPlwNHp9VPbq83b8af8y15hpKMzLw/KLn3eSM+Su3Xnr0BxFvJkKJA/2uUPSKZy1L2Aa I8PjFJNt3I8VHpnFwC2f7C54M5QNUMZ5tv1Sda1p7ff27bO4/4pwJVAwgR7hqPDwNaEdE5e 9X1vJ0+3ojsSa/6H7x3KA== X-UI-Out-Filterresults: notjunk:1; V01:K0:wpDrTwKjQqA=:1MRVRkbnSch/neTC2YjGze 35osCz5S77ILh0ZqEZXKnye7xEujvroIQMOJJDsBhrNXttXwaQeqNBDkfx8kN1vVX3QSsQ87u YTnAEzp7W1wXsntHOgf48EWNUr9XGrjnR1GyhfXMFoG825hP1OJtf91RR3eJHVLJ2A0uEdovp 2NY9oI5rJdArt3x3p2sDk9sOrozQeIDXcXQWDFJnLJLOXofvw9usse2HvCVzO5a0EwDAHM6fi PnbL4frirqnsFgUeMKEpnz4h6xcLlyh2fGiXoaBqPZ1xW1a+tupo1SLjxa5Qql8WnXuZUNVa4 22kvhD7eEW3jAvMFsNaYsDtFYzOhPgU4XWnlaML473rv0LwdVIhCchFnT9pC9grg9ZKFJJXua BiP9BX1+Sa51+eZ0Egtug0pY9Lxp5tPhwRTrMYkiF4bUDOguExgHHtYxIvfm7K/y3+z9NpS6N nvnADUWNlMrQtR9asU0bSwgWtAJqJG9VpaOtc9QwicpqYbWmcuea9vQssR1J/IBs4V90TCkTf zA+OHKGp84UwU6tY3MsD5wpBk1r8KdnUbL9vDTHYMLlNJLs0/sS56rjpSgmihkGW0PyfXGeyO kNh+RQFxPnK4e5Ht+Cg4p/KssCf+QFjgNmrU2jOXa3PBuOMEUUVAlKs8G0+5F8mWLhE2RVNJp 10csQTTc3dxh1a54s7saJvA9ASByWpds2MiKlNXGV/BvNhwPO8leUivbdhpF/K2rlThEVTUo1 E6xEyiQtuuxPHd1x0QQMoW3yyXmlVK//iWVSCFHEhTiBhqTrYNtJw9a2D/g= Cc: Arnd Bergmann <arnd@arndb.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo <tj@kernel.org>, akpm@linux-foundation.org, Linus Torvalds <torvalds@linux-foundation.org>, Guenter Roeck <linux@roeck-us.net>, linux-media@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> |
Series |
gcc-7 warnings
|
expand
|
diff --git a/drivers/sfi/sfi_core.c b/drivers/sfi/sfi_core.c index 296db7a69c27..a8f2313a2613 100644 --- a/drivers/sfi/sfi_core.c +++ b/drivers/sfi/sfi_core.c @@ -71,9 +71,12 @@ #include "sfi_core.h" -#define ON_SAME_PAGE(addr1, addr2) \ - (((unsigned long)(addr1) & PAGE_MASK) == \ - ((unsigned long)(addr2) & PAGE_MASK)) +static inline bool on_same_page(unsigned long addr1, unsigned long addr2) +{ + return (addr1 & PAGE_MASK) == (addr2 & PAGE_MASK); +} + +#define ON_SAME_PAGE(addr1, addr2) on_same_page((unsigned long)addr1, (unsigned long)addr2) #define TABLE_ON_PAGE(page, table, size) (ON_SAME_PAGE(page, table) && \ ON_SAME_PAGE(page, table + size))
With ccache in combination with gcc-6, we get a harmless warning for the sfi subsystem, as ccache only sees the preprocessed source: drivers/sfi/sfi_core.c: In function ‘sfi_map_table’: drivers/sfi/sfi_core.c:175:53: error: self-comparison always evaluates to true [-Werror=tautological-compare] Using an inline function to do the comparison tells the compiler what is going on even for preprocessed files, and avoids the warning. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/sfi/sfi_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)