]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
tools/power turbostat: Remove unnecessary fflush() call
authorZhang Rui <rui.zhang@intel.com>
Thu, 14 Nov 2024 07:59:43 +0000 (15:59 +0800)
committerLen Brown <len.brown@intel.com>
Sat, 30 Nov 2024 21:42:07 +0000 (16:42 -0500)
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>
tools/power/x86/turbostat/turbostat.c

index ae841baeca85126552c3a4acbac4145116e91b54..c0596ccf92cd490ca1e0b0f6697f471ca08700e8 100644 (file)
@@ -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");