aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang Rui <[email protected]>2024-11-14 07:59:43 +0000
committerLen Brown <[email protected]>2024-11-30 21:42:07 +0000
commitba99a4fc8c24dc7d35f18edb6e3b0a65345fbfa3 (patch)
treebbe6657df9e6f34f07528a2251c70a3acbde3e6f
parenttools/power turbostat: Enhance platform divergence description (diff)
downloadkernel-ba99a4fc8c24dc7d35f18edb6e3b0a65345fbfa3.tar.gz
kernel-ba99a4fc8c24dc7d35f18edb6e3b0a65345fbfa3.zip
tools/power turbostat: Remove unnecessary fflush() call
The graphics sysfs knobs are read-only, making the use of fflush() before reading them redundant. Remove the unnecessary fflush() call. Signed-off-by: Zhang Rui <[email protected]> Signed-off-by: Len Brown <[email protected]>
-rw-r--r--tools/power/x86/turbostat/turbostat.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index ae841baeca85..c0596ccf92cd 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -5780,12 +5780,11 @@ int snapshot_graphics(int idx)
case GFX_ACTMHz:
case SAM_MHz:
case SAM_ACTMHz:
- if (gfx_info[idx].fp == NULL) {
+ if (gfx_info[idx].fp == NULL)
gfx_info[idx].fp = fopen_or_die(gfx_info[idx].path, "r");
- } else {
+ else
rewind(gfx_info[idx].fp);
- fflush(gfx_info[idx].fp);
- }
+
retval = fscanf(gfx_info[idx].fp, "%d", &gfx_info[idx].val);
if (retval != 1)
err(1, "MHz");