From: Stafford Horne Date: Wed, 11 Jan 2017 15:16:05 +0000 (+0900) Subject: selftests/intel_pstate: Fix warning on loop index overflow X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=aff985fd07cf785fbd1544194f8fae08333e523e;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git selftests/intel_pstate: Fix warning on loop index overflow The build was showing the warning: aperf.c:60:27: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations] for (i=0; i<0x8fffffff; i++) { This change sets i, cpu and fd to unsigned int as they should not need to be signed. Cc: Prarit Bhargava Signed-off-by: Stafford Horne Signed-off-by: Shuah Khan --- diff --git a/tools/testing/selftests/intel_pstate/aperf.c b/tools/testing/selftests/intel_pstate/aperf.c index 6046e183f4ad..cd72f3dc83e9 100644 --- a/tools/testing/selftests/intel_pstate/aperf.c +++ b/tools/testing/selftests/intel_pstate/aperf.c @@ -14,7 +14,7 @@ void usage(char *name) { } int main(int argc, char **argv) { - int i, cpu, fd; + unsigned int i, cpu, fd; char msr_file_name[64]; long long tsc, old_tsc, new_tsc; long long aperf, old_aperf, new_aperf;