From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Joe Perches <joe@perches.com>
Cc: Stratos Karafotis <stratosk@semaphore.gr>,
Dirk Brandewie <dirk.brandewie@gmail.com>,
dirk.j.brandewie@intel.com,
Viresh Kumar <viresh.kumar@linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 6/7] cpufreq: intel_pstate: Trivial code cleanup
Date: Wed, 11 Jun 2014 02:23:27 +0200 [thread overview]
Message-ID: <2859027.TirvIA2s2c@vostro.rjw.lan> (raw)
In-Reply-To: <1402435605.4082.3.camel@joe-AO725>
On Tuesday, June 10, 2014 02:26:45 PM Joe Perches wrote:
> On Tue, 2014-06-10 at 23:38 +0200, Rafael J. Wysocki wrote:
>
> > > > is. And the result of (a * 100) / b may generally be different from
> > > > a * 100 / b for integers (if the division is carried out first).
> > >
> > > I thought that (a * 100) / b is always equivalent to a * 100 / b.
> >
> > I'm not actually sure if that's guaranteed by C standards.
>
> It is. left to right, same precedence.
>
> > It surely
> > wasn't some time ago (when there was no formal C standard).
>
> c89 is 25 years ago now.
Apparently, I'm old.
> > Either way, in my opinion it's better to put the parens into the expression
> > in this particular case to clearly state the intention.
>
> I don't think so.
Of course, you're free to disagree, but I guess you'll admit that
a * b / c is generally different from b / c * a and if you see something
like this it is hard to say at first sight whether or not this is intentional
or an expression ordering bug.
Rafael
next prev parent reply other threads:[~2014-06-11 0:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-09 21:01 [PATCH 6/7] cpufreq: intel_pstate: Trivial code cleanup Stratos Karafotis
2014-06-09 21:22 ` Joe Perches
2014-06-10 14:43 ` Stratos Karafotis
2014-06-10 15:12 ` Dirk Brandewie
2014-06-10 15:31 ` Rafael J. Wysocki
2014-06-10 17:26 ` Dirk Brandewie
2014-06-10 20:17 ` Rafael J. Wysocki
2014-06-10 20:14 ` Stratos Karafotis
2014-06-10 20:43 ` Rafael J. Wysocki
2014-06-10 21:02 ` Stratos Karafotis
2014-06-10 21:38 ` Rafael J. Wysocki
2014-06-10 21:26 ` Joe Perches
2014-06-11 0:23 ` Rafael J. Wysocki [this message]
2014-06-11 1:41 ` Joe Perches
2014-06-10 21:35 ` Stratos Karafotis
2014-06-11 0:24 ` Rafael J. Wysocki
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=2859027.TirvIA2s2c@vostro.rjw.lan \
--to=rjw@rjwysocki.net \
--cc=dirk.brandewie@gmail.com \
--cc=dirk.j.brandewie@intel.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=stratosk@semaphore.gr \
--cc=viresh.kumar@linaro.org \
/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