From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Nicholas Mc Guire <der.herr@hofr.at>, Tejun Heo <tj@kernel.org>
Cc: Nicholas Mc Guire <hofrat@osadl.org>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] libata: fixup return type of wait_for_completion_timeout
Date: Tue, 10 Feb 2015 19:38:41 +0300 [thread overview]
Message-ID: <54DA3411.3050309@cogentembedded.com> (raw)
In-Reply-To: <20150210155517.GB1883@opentech.at>
On 02/10/2015 06:55 PM, Nicholas Mc Guire wrote:
>> On Tue, Feb 10, 2015 at 03:39:36AM -0500, Nicholas Mc Guire wrote:
>>> - if (!rc) {
>>> + if (irq_timeout == 0) {
>> Why == 0 tho? This always bothers me. To match this style, we'd use
>> != 0 to test the other direction. In what way is "if (ret != 0)"
>> better than "if (ret)"? We're negating the two tests needlessly.
> The == 0 seemed better to me than ! here because it would read
> if (not irq_timeout) {
No, 'irq_timeout == 0' isn't really better.
> while it actually did time out - but this could be resolved by renaming
> irq_timeout to time_left (as was suggested by Sergei Shtylyov
> <sergei.shtylyov@cogentembedded.com> for a similar patch) and then it
> would read:
> if (time_left == 0) {
> which would nicely describe the timeout state.
'!time_left' also would.
> if that addresses your concerns then I'll fix it up and repost.
> thx!
> hofrat
MBR, Sergei
prev parent reply other threads:[~2015-02-10 16:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-10 8:39 [PATCH] libata: fixup return type of wait_for_completion_timeout Nicholas Mc Guire
2015-02-10 14:53 ` Tejun Heo
2015-02-10 15:55 ` Nicholas Mc Guire
2015-02-10 15:56 ` Tejun Heo
2015-02-10 16:38 ` Sergei Shtylyov [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=54DA3411.3050309@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=der.herr@hofr.at \
--cc=hofrat@osadl.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.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;
as well as URLs for NNTP newsgroup(s).