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: 9840317 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 C71D360393 for ; Fri, 14 Jul 2017 09:30:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B928D28791 for ; Fri, 14 Jul 2017 09:30:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE2732878F; Fri, 14 Jul 2017 09:30:26 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 349512878C for ; Fri, 14 Jul 2017 09:30:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753684AbdGNJaI (ORCPT ); Fri, 14 Jul 2017 05:30:08 -0400 Received: from mout.kundenserver.de ([217.72.192.74]:53924 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753175AbdGNJ3V (ORCPT ); Fri, 14 Jul 2017 05:29:21 -0400 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 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 , linux-acpi@vger.kernel.org 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= 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 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;