From patchwork Fri Jul 14 09:25:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9840287 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 1DC69602BD for ; Fri, 14 Jul 2017 09:28:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EDA02876A for ; Fri, 14 Jul 2017 09:28:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0332128789; Fri, 14 Jul 2017 09:28:45 +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=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3B4552876A for ; Fri, 14 Jul 2017 09:28:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D11D6E7B4; Fri, 14 Jul 2017 09:28:42 +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 [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC4C36E7B4 for ; Fri, 14 Jul 2017 09:28:40 +0000 (UTC) Received: from wuerfel.lan ([5.56.224.194]) by mrelayeu.kundenserver.de (mreue103 [212.227.15.145]) with ESMTPA (Nemesis) id 0Lgf13-1e223G06q5-00o1Nh; Fri, 14 Jul 2017 11:27:51 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org, Zhang Rui , "Rafael J. Wysocki" , Len Brown Subject: [PATCH 06/14] acpi: thermal: fix gcc-6/ccache warning Date: Fri, 14 Jul 2017 11:25:18 +0200 Message-Id: <20170714092540.1217397-7-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:oLTxUFhJg+VpbKIAYXvQENDPaLYl28tWm2koJg4I7Gb4Qk+oqZo ElUthycY6JdW2rY7kQQM/QqmNx2HkeC6Fqlsn8JoFDbdj6TjdEJTWcI6Z6b0zgpV8SwdCk6 LnZSXzgJ2iXeMkjcr7T7GDBRh7MXIGNZgoITe9O7sWz9UQAenJIdAiMZ0K8Fe+1Z2TasoUL nvVLDFX/wu/hRHkaZlz+w== X-UI-Out-Filterresults: notjunk:1; V01:K0:IE8SrzcsA9g=:nMnJz36TnzEezbEerEA9AV EBU115JxM9ytGlcIi3F68Dho0HMGJadkdwwSHrB65iFp2OWP6nBy2zfcoQojXgCXggYVgEY4M 6X+B53ezCFkkUr5NWU+Kvxm/h16dXIHqjNe7zAbCxqynEHE9ciFGFiQGwRp+6VD0SHKQMsDEI LnHY50XU7tNxUK+WCNQhZMQQb/i6xdfKWBf+bJy8plejJl79uWr29Mmxb93OAOLmZkbpOlSUG WbDi6obDxOSWDn5zUHyBI0YXTrB8LCN4cJ/wsugKdINPthJHdY3OesblC6B++1lq8i1ZZnzeM 8ph/Ua5w6EIhnWm9FcgVaSPjX1a+sgjRnRS3f08gdwssRveE87mMsI4dVK8cOb/nX2XcBvlPJ BtF8ox0gvhmgxk/4WoWYMmkHAAdiSX4+LuYwQ06tQeQoYHnLtqn//Q+rUAr9o2gjiQZ66sGY2 ThYASUsGfWBBia1O1IRolPkyLZ6UQHzAh/JthMML+BriraQ/3tIgagjFqYmdZKOg/WTMv/xwX 0gcIfsIrkSkpOGU9CfElNaeb+meAYgsiKXwx6XgZuQ4YrhZXTavPnB2Q4/tsAOCXRYto5GwKX e2L3KnF0vOzg++NqZZCKCVwzxVOJbr6KLxd7/x3VcYn00zhVna9NY5g1KK6Mozb4VWmttVUrj ZaVImcy/9/jF1XI0FX8E2DDCoPfaix3ZIzQUJ3L7pDcdp9dqxFOYaALE5TlYVWg2Tue298pxF tMK9tVKYA8ur6dph7sb7lBR6m1W4tj0Lx0YxL3onvh+ogWPtbMPBwcr3Up0= Cc: Arnd Bergmann , linux-acpi@vger.kernel.org, Greg Kroah-Hartman , dri-devel@lists.freedesktop.org, linux-ide@vger.kernel.org, Tejun Heo , akpm@linux-foundation.org, Linus Torvalds , Guenter Roeck , 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In some configurations, topology_physical_package_id() is trivially defined as '-1' for any input, resulting a comparison that is always true: drivers/acpi/processor_thermal.c: In function ‘cpufreq_set_cur_state’: drivers/acpi/processor_thermal.c:137:36: error: self-comparison always evaluates to true [-Werror=tautological-compare] By introducing a temporary variable, we can tell gcc that this is intentional. Signed-off-by: Arnd Bergmann --- drivers/acpi/processor_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index 59c3a5d1e600..411f3a7f4a7c 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c @@ -122,20 +122,22 @@ static int cpufreq_get_cur_state(unsigned int cpu) static int cpufreq_set_cur_state(unsigned int cpu, int state) { int i; + int id; if (!cpu_has_cpufreq(cpu)) return 0; reduction_pctg(cpu) = state; + id = topology_physical_package_id(cpu); + /* * Update all the CPUs in the same package because they all * contribute to the temperature and often share the same * frequency. */ for_each_online_cpu(i) { - if (topology_physical_package_id(i) == - topology_physical_package_id(cpu)) + if (topology_physical_package_id(i) == id) cpufreq_update_policy(i); } return 0;