From: David Miller <davem@davemloft.net>
To: Joerg.Friedrich@friedrich-kn.de
Cc: j.j.green@sheffield.ac.uk, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: sparc64 / bbc_i2c.c
Date: Tue, 27 Feb 2007 05:29:02 +0000 [thread overview]
Message-ID: <20070226.212902.78711266.davem@davemloft.net> (raw)
In-Reply-To: <20070227052239.GA30083@stardust.friedrich-kn.de>
From: Joerg Friedrich <Joerg.Friedrich@friedrich-kn.de>
Date: Tue, 27 Feb 2007 06:22:39 +0100
> Can you just tell me if it's sufficient to check for a return value >0
> of wait_event_interruptible_timeout? I was not sure so I extended the
> check to
> if ((val != -ERESTARTSYS) && (val > 0))
I changed the check to just "val > 0".
The comments in the kernel around the implementation and
declaration of the function wait_event_interruptible()
VERY CLEARLY state that the possible return values are:
1) Negative error code on interrupt
2) Zero if timeout expired
3) Positive non-zero value if condition became true before
timeout expired
So there is no doubt that "val > 0" is sufficient.
WARNING: multiple messages have this Message-ID (diff)
From: David Miller <davem@davemloft.net>
To: Joerg.Friedrich@friedrich-kn.de
Cc: j.j.green@sheffield.ac.uk, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: sparc64 / bbc_i2c.c
Date: Mon, 26 Feb 2007 21:29:02 -0800 (PST) [thread overview]
Message-ID: <20070226.212902.78711266.davem@davemloft.net> (raw)
In-Reply-To: <20070227052239.GA30083@stardust.friedrich-kn.de>
From: Joerg Friedrich <Joerg.Friedrich@friedrich-kn.de>
Date: Tue, 27 Feb 2007 06:22:39 +0100
> Can you just tell me if it's sufficient to check for a return value >0
> of wait_event_interruptible_timeout? I was not sure so I extended the
> check to
> if ((val != -ERESTARTSYS) && (val > 0))
I changed the check to just "val > 0".
The comments in the kernel around the implementation and
declaration of the function wait_event_interruptible()
VERY CLEARLY state that the possible return values are:
1) Negative error code on interrupt
2) Zero if timeout expired
3) Positive non-zero value if condition became true before
timeout expired
So there is no doubt that "val > 0" is sufficient.
next prev parent reply other threads:[~2007-02-27 5:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-20 13:27 sparc64 / bbc_i2c.c J.J. Green
2007-02-25 12:47 ` Andrew Morton
2007-02-25 12:47 ` Andrew Morton
2007-02-25 13:33 ` Emanuele Rocca
2007-02-25 13:33 ` Emanuele Rocca
2007-02-25 23:58 ` J.J.Green
2007-02-25 23:58 ` J.J.Green
2007-02-26 18:12 ` David Miller
2007-02-26 18:12 ` David Miller
2007-02-27 5:22 ` Joerg Friedrich
2007-02-27 5:22 ` Joerg Friedrich
2007-02-27 5:29 ` David Miller [this message]
2007-02-27 5:29 ` David Miller
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=20070226.212902.78711266.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Joerg.Friedrich@friedrich-kn.de \
--cc=akpm@linux-foundation.org \
--cc=j.j.green@sheffield.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=sparclinux@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.