Skip to content

Commit 793207b

Browse files
committed
x86/resctrl: Fix a silly -Wunused-but-set-variable warning
clang correctly complains arch/x86/kernel/cpu/resctrl/rdtgroup.c:1456:6: warning: variable \ 'h' set but not used [-Wunused-but-set-variable] u32 h; ^ but it can't know whether this use is innocuous or really a problem. There's a reason why those warning switches are behind a W=1 and not enabled by default - yes, one needs to do: make W=1 CC=clang HOSTCC=clang arch/x86/kernel/cpu/resctrl/ with clang 14 in order to trigger it. I would normally not take a silly fix like that but this one is simple and doesn't make the code uglier so... Reported-by: kernel test robot <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Acked-by: Reinette Chatre <[email protected]> Tested-by: Babu Moger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0a363fb commit 793207b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/kernel/cpu/resctrl/rdtgroup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,17 +1453,17 @@ static void mon_event_config_read(void *info)
14531453
{
14541454
struct mon_config_info *mon_info = info;
14551455
unsigned int index;
1456-
u32 h;
1456+
u64 msrval;
14571457

14581458
index = mon_event_config_index_get(mon_info->evtid);
14591459
if (index == INVALID_CONFIG_INDEX) {
14601460
pr_warn_once("Invalid event id %d\n", mon_info->evtid);
14611461
return;
14621462
}
1463-
rdmsr(MSR_IA32_EVT_CFG_BASE + index, mon_info->mon_config, h);
1463+
rdmsrl(MSR_IA32_EVT_CFG_BASE + index, msrval);
14641464

14651465
/* Report only the valid event configuration bits */
1466-
mon_info->mon_config &= MAX_EVT_CONFIG_BITS;
1466+
mon_info->mon_config = msrval & MAX_EVT_CONFIG_BITS;
14671467
}
14681468

14691469
static void mondata_config_read(struct rdt_domain *d, struct mon_config_info *mon_info)

0 commit comments

Comments
 (0)