Skip to content

Commit 638b509

Browse files
Lee Jonesrafaeljw
authored andcommitted
cpufreq: powernow-k8: Mark 'hi' and 'lo' dummy variables as __always_unused
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; | ^~ Signed-off-by: Lee Jones <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent a7b9093 commit 638b509

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/powernow-k8.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static u32 convert_fid_to_vco_fid(u32 fid)
8686
*/
8787
static int pending_bit_stuck(void)
8888
{
89-
u32 lo, hi;
89+
u32 lo, hi __always_unused;
9090

9191
rdmsr(MSR_FIDVID_STATUS, lo, hi);
9292
return lo & MSR_S_LO_CHANGE_PENDING ? 1 : 0;
@@ -282,7 +282,7 @@ static int core_voltage_pre_transition(struct powernow_k8_data *data,
282282
{
283283
u32 rvosteps = data->rvo;
284284
u32 savefid = data->currfid;
285-
u32 maxvid, lo, rvomult = 1;
285+
u32 maxvid, lo __always_unused, rvomult = 1;
286286

287287
pr_debug("ph1 (cpu%d): start, currfid 0x%x, currvid 0x%x, reqvid 0x%x, rvo 0x%x\n",
288288
smp_processor_id(),

0 commit comments

Comments
 (0)