aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStafford Horne <shorne@gmail.com>2017-01-11 10:16:05 -0500
committerShuah Khan <shuahkh@osg.samsung.com>2017-01-19 12:30:34 -0500
commitaff985fd07cf785fbd1544194f8fae08333e523e (patch)
treee0eac4aad5df475e6ffe743abca8a48e0eb0ac85
parent4da39ceb269cee9f96815a54f97931a7e59f9e7f (diff)
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 <prarit@redhat.com> Signed-off-by: Stafford Horne <shorne@gmail.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
-rw-r--r--tools/testing/selftests/intel_pstate/aperf.c2
1 files changed, 1 insertions, 1 deletions
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) {
14} 14}
15 15
16int main(int argc, char **argv) { 16int main(int argc, char **argv) {
17 int i, cpu, fd; 17 unsigned int i, cpu, fd;
18 char msr_file_name[64]; 18 char msr_file_name[64];
19 long long tsc, old_tsc, new_tsc; 19 long long tsc, old_tsc, new_tsc;
20 long long aperf, old_aperf, new_aperf; 20 long long aperf, old_aperf, new_aperf;