lkml.org 
[lkml]   [2018]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH][v2] tools/power turbostat: if --max_loop, print for specific time of loops
From
Date
On Tue, 2018-04-10 at 22:51 +0800, Yu Chen wrote:
> + case 't':
> + {
> + int loops = strtod(optarg, NULL);
> +
> + if (loops <= 0) {
> + fprintf(outf, "loops %d should be positive number\n",
> + iterations);
> + exit(2);
> + }
> + iterations = loops;
> + }

What is the point of the additional {} scope and the 'loops' variable
in it? You could use the 'iterations' variable directly and simplify
the code.

Artem.

\
 
 \ /
  Last update: 2018-04-11 11:29    [W:0.050 / U:2.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site