Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753832AbdGNJaJ (ORCPT ); Fri, 14 Jul 2017 05:30:09 -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 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1406 Lines: 46 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; -- 2.9.0