From patchwork Fri Jul 14 09:30:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9840323 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 44857602BD for ; Fri, 14 Jul 2017 09:31:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36B2C28787 for ; Fri, 14 Jul 2017 09:31:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2AAD22878A; Fri, 14 Jul 2017 09:31:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9A8828787 for ; Fri, 14 Jul 2017 09:31:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751403AbdGNJbR (ORCPT ); Fri, 14 Jul 2017 05:31:17 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:59663 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751190AbdGNJbQ (ORCPT ); Fri, 14 Jul 2017 05:31:16 -0400 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 To: linux-kernel@vger.kernel.org, Len Brown Cc: Greg Kroah-Hartman , Linus Torvalds , Tejun Heo , Guenter Roeck , linux-ide@vger.kernel.org, linux-media@vger.kernel.org, akpm@linux-foundation.org, dri-devel@lists.freedesktop.org, Arnd Bergmann 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= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/sfi/sfi_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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))