public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yu Chen <yu.c.chen@intel.com>
To: Artem Bityutskiy <dedekind1@gmail.com>
Cc: Len Brown <lenb@kernel.org>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][v2] tools/power turbostat: if --max_loop, print for specific time of loops
Date: Wed, 11 Apr 2018 18:15:29 +0800	[thread overview]
Message-ID: <20180411101529.GA12068@yu-chen.sh.intel.com> (raw)
In-Reply-To: <1523438944.2753.207.camel@gmail.com>

On Wed, Apr 11, 2018 at 12:29:04PM +0300, Artem Bityutskiy wrote:
> 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.
Got your point, will change it.
> 
> Artem.

      reply	other threads:[~2018-04-11 10:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 14:51 [PATCH][v2] tools/power turbostat: if --max_loop, print for specific time of loops Yu Chen
2018-04-11  9:29 ` Artem Bityutskiy
2018-04-11 10:15   ` Yu Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180411101529.GA12068@yu-chen.sh.intel.com \
    --to=yu.c.chen@intel.com \
    --cc=dedekind1@gmail.com \
    --cc=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox