Skip to content

Commit ba99a4f

Browse files
zhang-ruilenb
authored andcommitted
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 <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent 1958f4e commit ba99a4f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/power/x86/turbostat/turbostat.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5780,12 +5780,11 @@ int snapshot_graphics(int idx)
57805780
case GFX_ACTMHz:
57815781
case SAM_MHz:
57825782
case SAM_ACTMHz:
5783-
if (gfx_info[idx].fp == NULL) {
5783+
if (gfx_info[idx].fp == NULL)
57845784
gfx_info[idx].fp = fopen_or_die(gfx_info[idx].path, "r");
5785-
} else {
5785+
else
57865786
rewind(gfx_info[idx].fp);
5787-
fflush(gfx_info[idx].fp);
5788-
}
5787+
57895788
retval = fscanf(gfx_info[idx].fp, "%d", &gfx_info[idx].val);
57905789
if (retval != 1)
57915790
err(1, "MHz");

0 commit comments

Comments
 (0)