linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: 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 16:55:17 +0100	[thread overview]
Message-ID: <20150210155517.GB1883@opentech.at> (raw)
In-Reply-To: <20150210145341.GJ3220@htj.duckdns.org>

On Tue, 10 Feb 2015, Tejun Heo 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) {

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.

if that addresses your concerns then I'll fix it up and repost.

thx!
hofrat

  reply	other threads:[~2015-02-10 15:55 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 [this message]
2015-02-10 15:56     ` Tejun Heo
2015-02-10 16:38     ` Sergei Shtylyov

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=20150210155517.GB1883@opentech.at \
    --to=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).