aio: simplify read_events()

Change wait_event_hrtimeout() to not call __wait_event_hrtimeout() if
timeout == 0, this matches other _timeout() helpers in wait.h.

This allows to simplify its only user, read_events(), it no longer needs
to optimize the "until == 0" case by hand.

Note: this patch doesn't use ___wait_cond_timeout because _hrtimeout()
also differs in that it returns 0 if succeeds and -ETIME on timeout. 
Perhaps we should change this to make it fully compatible with other

Signed-off-by: Oleg Nesterov <>
Reviewed-by: Andrew Morton <>
Cc: Benjamin LaHaise <>
Cc: Arnd Bergmann <>
Cc: David Laight <David.Laight@ACULAB.COM>
Cc: Deepa Dinamani <>
Cc: "Eric W. Biederman" <>
Cc: Eric Wong <>
Cc: Peter Zijlstra <>
Cc: Al Viro <>
Signed-off-by: Andrew Morton <>
2 files changed