linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: rjw@rjwysocki.net, viresh.kumar@linaro.org
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Lee Jones <lee.jones@linaro.org>,
	Andreas Herrmann <herrmann.der.user@googlemail.com>,
	Dominik Brodowski <linux@brodo.de>, Pavel Machek <pavel@ucw.cz>,
	Paul Devriendt <paul.devriendt@amd.com>,
	Mark Langsdorf <mark.langsdorf@amd.com>
Subject: [PATCH v2 10/13] cpufreq: powernow-k8: Mark 'hi' and 'lo' dummy variables as __always_unused
Date: Wed, 15 Jul 2020 09:26:31 +0100	[thread overview]
Message-ID: <20200715082634.3024816-11-lee.jones@linaro.org> (raw)
In-Reply-To: <20200715082634.3024816-1-lee.jones@linaro.org>

if we fail to use a variable, even a dummy ones, then the compiler
complains that it is set but not used.  We know this is fine, so we
set them as __always_unused here to let the compiler know.

Fixes the following W=1 kernel build warning(s):

 drivers/cpufreq/powernow-k8.c: In function ‘pending_bit_stuck’:
 drivers/cpufreq/powernow-k8.c:89:10: warning: variable ‘hi’ set but not used [-Wunused-but-set-variable]
 89 | u32 lo, hi;
 | ^~
 drivers/cpufreq/powernow-k8.c: In function ‘core_voltage_pre_transition’:
 drivers/cpufreq/powernow-k8.c:285:14: warning: variable ‘lo’ set but not used [-Wunused-but-set-variable]
 285 | u32 maxvid, lo, rvomult = 1;
 | ^~

Cc: Andreas Herrmann <herrmann.der.user@googlemail.com>
Cc: Dominik Brodowski <linux@brodo.de>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Paul Devriendt <paul.devriendt@amd.com>
Cc: Mark Langsdorf <mark.langsdorf@amd.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/cpufreq/powernow-k8.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
index 3984959eed1d5..0acc9e241cd7d 100644
--- a/drivers/cpufreq/powernow-k8.c
+++ b/drivers/cpufreq/powernow-k8.c
@@ -86,7 +86,7 @@ static u32 convert_fid_to_vco_fid(u32 fid)
  */
 static int pending_bit_stuck(void)
 {
-	u32 lo, hi;
+	u32 lo, hi __always_unused;
 
 	rdmsr(MSR_FIDVID_STATUS, lo, hi);
 	return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0;
@@ -282,7 +282,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
 {
 	u32 rvosteps = data->rvo;
 	u32 savefid = data->currfid;
-	u32 maxvid, lo, rvomult = 1;
+	u32 maxvid, lo __always_unused, rvomult = 1;
 
 	pr_debug("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",
 		smp_processor_id(),
-- 
2.25.1


  parent reply	other threads:[~2020-07-15  8:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  8:26 [PATCH v2 00/13] Rid W=1 warnings in CPUFreq Lee Jones
2020-07-15  8:26 ` [PATCH v2 01/13] cpufreq: freq_table: Demote obvious misuse of kerneldoc to standard comment blocks Lee Jones
2020-07-15  8:26 ` [PATCH v2 02/13] cpufreq: cpufreq: Demote lots of function headers unworthy of kerneldoc status Lee Jones
2020-07-15  8:26 ` [PATCH v2 03/13] cpufreq: cpufreq_governor: Demote store_sampling_rate() header to standard comment block Lee Jones
2020-07-15  8:26 ` [PATCH v2 04/13] cpufreq: sti-cpufreq: Fix some formatting and misspelling issues Lee Jones
2020-07-15  9:46   ` Viresh Kumar
2020-07-15  8:26 ` [PATCH v2 05/13] cpufreq: pasemi: Include header file for {check,restore}_astate prototypes Lee Jones
2020-07-15  8:26 ` [PATCH v2 06/13] cpufreq: powernv-cpufreq: Functions only used in call-backs should be static Lee Jones
2020-07-15  9:45   ` Viresh Kumar
2020-07-15 10:13     ` Lee Jones
2020-07-15  8:26 ` [PATCH v2 07/13] cpufreq: powernv-cpufreq: Fix a bunch of kerneldoc related issues Lee Jones
2020-07-15  8:26 ` [PATCH v2 08/13] cpufreq: acpi-cpufreq: Mark 'dummy' variable as __always_unused Lee Jones
2020-07-15  8:26 ` [PATCH v2 09/13] cpufreq: acpi-cpufreq: Mark sometimes used ID structs as __maybe_unused Lee Jones
2020-07-15  8:26 ` Lee Jones [this message]
2020-07-22 12:50   ` [PATCH v2 10/13] cpufreq: powernow-k8: Mark 'hi' and 'lo' dummy variables as __always_unused Pavel Machek
2020-07-15  8:26 ` [PATCH v2 11/13] cpufreq: pcc-cpufreq: Mark sometimes used ID structs as __maybe_unused Lee Jones
2020-07-15  8:26 ` [PATCH v2 12/13] cpufreq: intel_pstate: Supply struct attribute description for get_aperf_mperf_shift() Lee Jones
2020-07-15  8:26 ` [PATCH v2 13/13] cpufreq: amd_freq_sensitivity: Mark sometimes used ID structs as __maybe_unused Lee Jones
2020-07-15  9:46 ` [PATCH v2 00/13] Rid W=1 warnings in CPUFreq Viresh Kumar
2020-07-15 13:23 ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200715082634.3024816-11-lee.jones@linaro.org \
    --to=lee.jones@linaro.org \
    --cc=herrmann.der.user@googlemail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@brodo.de \
    --cc=mark.langsdorf@amd.com \
    --cc=paul.devriendt@amd.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).