[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200715082634.3024816-9-lee.jones@linaro.org>
Date: Wed, 15 Jul 2020 09:26:29 +0100
From: Lee Jones <lee.jones@...aro.org>
To: rjw@...ysocki.net, viresh.kumar@...aro.org
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org, Lee Jones <lee.jones@...aro.org>,
Andy Grover <andrew.grover@...el.com>,
Paul Diefenbaugh <paul.s.diefenbaugh@...el.com>,
Dominik Brodowski <linux@...do.de>,
Denis Sadykov <denis.m.sadykov@...el.com>
Subject: [PATCH v2 08/13] cpufreq: acpi-cpufreq: Mark 'dummy' variable as __always_unused
If we fail to use a variable, even a 'dummy' one, then the compiler
complains that it is set but not used. We know this is fine, so we
set it as __always_unused to let the compiler know.
Fixes the following W=1 kernel build warning(s):
drivers/cpufreq/acpi-cpufreq.c: In function ‘cpu_freq_read_intel’:
drivers/cpufreq/acpi-cpufreq.c:247:11: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
drivers/cpufreq/acpi-cpufreq.c: In function ‘cpu_freq_read_amd’:
drivers/cpufreq/acpi-cpufreq.c:265:11: warning: variable ‘dummy’ set but not used [-Wunused-but-set-variable]
Cc: Andy Grover <andrew.grover@...el.com>
Cc: Paul Diefenbaugh <paul.s.diefenbaugh@...el.com>
Cc: Dominik Brodowski <linux@...do.de>
Cc: Denis Sadykov <denis.m.sadykov@...el.com>
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---
drivers/cpufreq/acpi-cpufreq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 429e5a36c08a9..6b3d8355c8dea 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -244,7 +244,7 @@ static unsigned extract_freq(struct cpufreq_policy *policy, u32 val)
static u32 cpu_freq_read_intel(struct acpi_pct_register *not_used)
{
- u32 val, dummy;
+ u32 val, dummy __always_unused;
rdmsr(MSR_IA32_PERF_CTL, val, dummy);
return val;
@@ -261,7 +261,7 @@ static void cpu_freq_write_intel(struct acpi_pct_register *not_used, u32 val)
static u32 cpu_freq_read_amd(struct acpi_pct_register *not_used)
{
- u32 val, dummy;
+ u32 val, dummy __always_unused;
rdmsr(MSR_AMD_PERF_CTL, val, dummy);
return val;
--
2.25.1
Powered by blists - more mailing lists