git: 8ea6d9f33ee3 - main - hwpstate_intel(4): Debug sysctl: Style
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 26 Jun 2026 21:37:48 UTC
The branch main has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=8ea6d9f33ee3bb37b381d547517ae612ba1640db
commit 8ea6d9f33ee3bb37b381d547517ae612ba1640db
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-06-26 14:03:51 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-06-26 21:36:44 +0000
hwpstate_intel(4): Debug sysctl: Style
Introduce 'error', set it to the result of rdmsr_safe() and use 'error'
as the test expression.
No functional change (intended).
Fixes: 29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind")
MFC after: 2 weeks
Event: Halifax Hackathon 202606
Location: Dalhousie CS Faculty building
Sponsored by: The FreeBSD Foundation
---
sys/x86/cpufreq/hwpstate_intel.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c
index 71f490a00bdc..b02d212653d3 100644
--- a/sys/x86/cpufreq/hwpstate_intel.c
+++ b/sys/x86/cpufreq/hwpstate_intel.c
@@ -157,18 +157,26 @@ static void
get_cppc_regs_cb(void *args)
{
struct get_cppc_regs_data *const data = args;
+ int error;
data->res = 0;
- if (rdmsr_safe(MSR_IA32_PM_ENABLE, &data->enabled))
+ error = rdmsr_safe(MSR_IA32_PM_ENABLE, &data->enabled);
+ if (error != 0)
data->res |= HWP_ERROR_CPPC_ENABLE;
- if (rdmsr_safe(MSR_IA32_HWP_CAPABILITIES, &data->caps))
+
+ error = rdmsr_safe(MSR_IA32_HWP_CAPABILITIES, &data->caps);
+ if (error != 0)
data->res |= HWP_ERROR_CPPC_CAPS;
- if (rdmsr_safe(MSR_IA32_HWP_REQUEST, &data->request))
+
+ error = rdmsr_safe(MSR_IA32_HWP_REQUEST, &data->request);
+ if (error != 0)
data->res |= HWP_ERROR_CPPC_REQUEST;
if (data->sc->hwp_pkg_ctrl) {
- if (rdmsr_safe(MSR_IA32_HWP_REQUEST_PKG, &data->request_pkg))
+ error = rdmsr_safe(MSR_IA32_HWP_REQUEST_PKG,
+ &data->request_pkg);
+ if (error != 0)
data->res |= HWP_ERROR_CPPC_REQUEST_PKG;
}
}