]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/power turbostat: Consistently use print_float_value()
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 11 Mar 2026 09:00:31 +0000 (11:00 +0200)
committerLen Brown <len.brown@intel.com>
Wed, 18 Mar 2026 03:39:42 +0000 (23:39 -0400)
Fix the PMT thread code to use print_float_value(),
to be consistent with the PMT core and package code.

[lenb: commit message]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c

index b985bce69142f67464c0df33e2da9c28629ef842..9744f9caac9af9bba236756ed53852d1fac15986 100644 (file)
@@ -3489,12 +3489,12 @@ int format_counters(PER_THREAD_PARAMS)
 
                case PMT_TYPE_XTAL_TIME:
                        value_converted = pct(value_raw / crystal_hz, interval_float);
-                       outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted);
+                       outp += print_float_value(&printed, delim, value_converted);
                        break;
 
                case PMT_TYPE_TCORE_CLOCK:
                        value_converted = pct(value_raw / tcore_clock_freq_hz, interval_float);
-                       outp += sprintf(outp, "%s%.2f", (printed++ ? delim : ""), value_converted);
+                       outp += print_float_value(&printed, delim, value_converted);
                }
        }