提交 aff985fd 编写于 作者: S Stafford Horne 提交者: Shuah Khan

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: NStafford Horne <shorne@gmail.com>
Signed-off-by: NShuah Khan <shuahkh@osg.samsung.com>
上级 4da39ceb
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册