Message ID | 20170714092540.1217397-7-arnd@arndb.de |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp650510qge; Fri, 14 Jul 2017 02:29:13 -0700 (PDT) X-Received: by 10.98.50.133 with SMTP id y127mr4092122pfy.242.1500024553584; Fri, 14 Jul 2017 02:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500024553; cv=none; d=google.com; s=arc-20160816; b=SDZUGM23CRD0qGyLSqwPPN6p7vw6htxm3uwcJAZlPDKUGta7CLycm6WgKDrXqXvX0d R+uNtCqq4+RCr6hlvXz9X5PCtucsh/3GszG84jKSuxgqtJeMslUlf1ew54lXTrRbIBe6 /ye4v20vrRtDR1nLKnxmlfIqavfo1FgiTuOOk6VrTIXuZHpXIu1E/NRAsiqiRxsADMaA U/xiyFGd+jip1u8RcJMiI5kLLqIXdaORHvwJhpgAqT98OhXFa+Mc/7w5m3dfdX5udRWb 3zRu6KK9Wp52cpiMk/QAEmLQJHLScWk+Z5uR8Ub+WgktTSGWeTTz2FKBSFyoZ+JJR0wG jiOg== 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=7LvrKEy8FI142EtlSCPsA2YUN0mmWuVM+HfEB8PKaHk=; b=dtV68CJhE8k4E4hzp7MqRNSE1hS7sp+isS99uR6o3LKsdEwwTQ5YBhhYTZPm6oXYID nCwXHQsSmwWLUygjIqHlaZLVhYBjcVrhkRBmXhgZcFo5Ge607FmuetaRNYWjxtpW4l2+ EmSQVU0Ed6l1m+oRCO0Ya8aatoC946P6/RriKm7VkAnextiFIZwpZPWQrZBEW8hj0SeI URVwI0o5WlNvNCFIQl+mgCB6sAmUYl1hyHVntqc4uvPqhJspz/NCLwx2fnYqD79PE+Rz UVKOOxLjLtGQBw60regvt+utx1RoyCRPoOL6pSWX57SCLirWV4oZ95VIAfdBsl1KZie6 5psQ== 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 g9si6242095pli.273.2017.07.14.02.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 02:29: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 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 <dri-devel@lists.freedesktop.org>; 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 <arnd@arndb.de> To: linux-kernel@vger.kernel.org, Zhang Rui <rui.zhang@intel.com>, "Rafael J. Wysocki" <rjw@rjwysocki.net>, Len Brown <lenb@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= Cc: Arnd Bergmann <arnd@arndb.de>, linux-acpi@vger.kernel.org, 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/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;
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 <arnd@arndb.de> --- drivers/acpi/processor_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)