From e1708e514a368ca2cb05a5c6e122919005027bad Mon Sep 17 00:00:00 2001 From: Len Brown Date: Mon, 4 May 2026 15:32:12 -0400 Subject: [PATCH] tools/power turbostat: Cleanup: bool force_load It is confusing to increment what is effectively a bool value. Define force_load as bool, and access it accordingly. Assisted-by: Claude:claude-sonnet-4.6 Signed-off-by: Len Brown --- tools/power/x86/turbostat/turbostat.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c index 3248a6a60732..dbbaa737342d 100644 --- a/tools/power/x86/turbostat/turbostat.c +++ b/tools/power/x86/turbostat/turbostat.c @@ -523,7 +523,7 @@ unsigned int valid_rapl_msrs; unsigned int summary_only; unsigned int list_header_only; unsigned int dump_only; -unsigned int force_load; +bool force_load; unsigned int cpuid_has_aperf_mperf; unsigned int cpuid_has_hv; unsigned int has_aperf_access; @@ -1360,7 +1360,7 @@ void probe_platform_features(unsigned int family, unsigned int model) if (authentic_amd || hygon_genuine) { /* fallback to default features on unsupported models */ - force_load++; + force_load = true; if (max_extended_level >= 0x80000007) { unsigned int eax, ebx, ecx, edx; @@ -1383,7 +1383,7 @@ void probe_platform_features(unsigned int family, unsigned int model) } end: - if (force_load && !platform) { + if ((force_load == true) && !platform) { fprintf(outf, "Forced to run on unsupported platform!\n"); platform = &default_features; } @@ -11555,7 +11555,7 @@ void cmdline(int argc, char **argv) bic_lookup(&bic_enabled, optarg, SHOW_LIST); break; case 'f': - force_load++; + force_load = true; break; case 'd': debug++;