Commit 56a85eeb authored by Nathan Fontenot's avatar Nathan Fontenot Committed by Shuah Khan
Browse files

cpupower: Condense pstate enabled bit checks in decode_pstates()



The enabled bit (bit 63) is common for all families so we can remove
the multiple enabled checks based on family and have a common check
for HW pstate enabled.

Signed-off-by: default avatarNathan Fontenot <nathan.fontenot@amd.com>
Reviewed-by: default avatarRobert Richter <rrichter@amd.com>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 23765b82
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -113,9 +113,9 @@ int decode_pstates(unsigned int cpu, unsigned int cpu_family,
		}
		if (read_msr(cpu, MSR_AMD_PSTATE + i, &pstate.val))
			return -1;
		if ((cpu_family == 0x17) && (!pstate.pstatedef.en))
			continue;
		else if (!pstate.pstate.en)

		/* The enabled bit (bit 63) is common for all families */
		if (!pstate.pstatedef.en)
			continue;

		pstates[i] = get_cof(cpu_family, pstate);