diff options
author | Peter Zijlstra <peterz@infradead.org> | 2013-10-02 05:22:33 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-10-04 04:16:25 -0400 |
commit | 35a2af94c7ce7130ca292c68b1d27fcfdb648f6b (patch) | |
tree | 10b28670fb387984751de104913db9408ade8741 /arch/mips/kernel/rtlx.c | |
parent | ebdc195f2ec68576876216081035293e37318e86 (diff) |
sched/wait: Make the __wait_event*() interface more friendly
Change all __wait_event*() implementations to match the corresponding
wait_event*() signature for convenience.
In particular this does away with the weird 'ret' logic. Since there
are __wait_event*() users this requires we update them too.
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20131002092529.042563462@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/mips/kernel/rtlx.c')
-rw-r--r-- | arch/mips/kernel/rtlx.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index d763f11e35e2..2c12ea1668d1 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -172,8 +172,9 @@ int rtlx_open(int index, int can_sleep) | |||
172 | if (rtlx == NULL) { | 172 | if (rtlx == NULL) { |
173 | if( (p = vpe_get_shared(tclimit)) == NULL) { | 173 | if( (p = vpe_get_shared(tclimit)) == NULL) { |
174 | if (can_sleep) { | 174 | if (can_sleep) { |
175 | __wait_event_interruptible(channel_wqs[index].lx_queue, | 175 | ret = __wait_event_interruptible( |
176 | (p = vpe_get_shared(tclimit)), ret); | 176 | channel_wqs[index].lx_queue, |
177 | (p = vpe_get_shared(tclimit))); | ||
177 | if (ret) | 178 | if (ret) |
178 | goto out_fail; | 179 | goto out_fail; |
179 | } else { | 180 | } else { |
@@ -263,11 +264,10 @@ unsigned int rtlx_read_poll(int index, int can_sleep) | |||
263 | /* data available to read? */ | 264 | /* data available to read? */ |
264 | if (chan->lx_read == chan->lx_write) { | 265 | if (chan->lx_read == chan->lx_write) { |
265 | if (can_sleep) { | 266 | if (can_sleep) { |
266 | int ret = 0; | 267 | int ret = __wait_event_interruptible( |
267 | 268 | channel_wqs[index].lx_queue, | |
268 | __wait_event_interruptible(channel_wqs[index].lx_queue, | ||
269 | (chan->lx_read != chan->lx_write) || | 269 | (chan->lx_read != chan->lx_write) || |
270 | sp_stopping, ret); | 270 | sp_stopping); |
271 | if (ret) | 271 | if (ret) |
272 | return ret; | 272 | return ret; |
273 | 273 | ||
@@ -440,14 +440,13 @@ static ssize_t file_write(struct file *file, const char __user * buffer, | |||
440 | 440 | ||
441 | /* any space left... */ | 441 | /* any space left... */ |
442 | if (!rtlx_write_poll(minor)) { | 442 | if (!rtlx_write_poll(minor)) { |
443 | int ret = 0; | 443 | int ret; |
444 | 444 | ||
445 | if (file->f_flags & O_NONBLOCK) | 445 | if (file->f_flags & O_NONBLOCK) |
446 | return -EAGAIN; | 446 | return -EAGAIN; |
447 | 447 | ||
448 | __wait_event_interruptible(channel_wqs[minor].rt_queue, | 448 | ret = __wait_event_interruptible(channel_wqs[minor].rt_queue, |
449 | rtlx_write_poll(minor), | 449 | rtlx_write_poll(minor)); |
450 | ret); | ||
451 | if (ret) | 450 | if (ret) |
452 | return ret; | 451 | return ret; |
453 | } | 452 | } |