linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu Chen <yu.c.chen@intel.com>
To: "Bityutskiy, Artem" <artem.bityutskiy@intel.com>
Cc: "lenb@kernel.org" <lenb@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>
Subject: Re: [PATCH][RFC] tools/power turbostat: if --max_loop, print for specific time of loops
Date: Tue, 10 Apr 2018 21:00:02 +0800	[thread overview]
Message-ID: <20180410130002.GB29464@yu-chen.sh.intel.com> (raw)
In-Reply-To: <1523358141.2753.194.camel@intel.com>

Hi,
On Tue, Apr 10, 2018 at 07:02:22PM +0800, Bityutskiy, Artem wrote:
> On Tue, 2018-04-10 at 18:18 +0800, Yu Chen wrote:
> > @@ -5076,6 +5084,15 @@ void cmdline(int argc, char **argv)
> >                         print_version();
> >                         exit(0);
> >                         break;
> > +               case 'x':
> > +                       {
> > +                               unsigned int loops = strtod(optarg, NULL);
> 
> It would make sense to error out here if you get a value <= 0.
> 
OK.
> > +
> > +                               if (loops % 2)
> > +                                       loops++;
> 
> What is this for?
> 
It was intended to make the number of loops even for simplify.
But after rethink about this, it might not be necessary. I'll
change it.

> > +                               max_loops = loops;
> 
> Is the "loops" variable really needed? Can you strtod directly to
> max_loops?
If the sanity check for user input is added then I think the local
variable is needed.

Thanks,
Yu
> 
> -- 
> Best Regards,
> Artem Bityutskiy

      reply	other threads:[~2018-04-10 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 10:18 [PATCH][RFC] tools/power turbostat: if --max_loop, print for specific time of loops Yu Chen
2018-04-10 10:22 ` Rafael J. Wysocki
2018-04-10 10:53   ` Artem Bityutskiy
2018-04-10 12:19   ` Yu Chen
2018-04-10 11:02 ` Bityutskiy, Artem
2018-04-10 13:00   ` 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=20180410130002.GB29464@yu-chen.sh.intel.com \
    --to=yu.c.chen@intel.com \
    --cc=artem.bityutskiy@intel.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;
as well as URLs for NNTP newsgroup(s).