From f2d101257bbe359e2c6b1b5d243e0be096f2a0ad Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Fri, 28 Jun 2013 16:52:58 +1000 Subject: [PATCH] fix warnings from ?: operator in wait.h Signed-off-by: Stephen Rothwell --- include/linux/wait.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/include/linux/wait.h b/include/linux/wait.h index 1c08a6c2e2f0..f3b793da651f 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -197,7 +197,12 @@ wait_queue_head_t *bit_waitqueue(void *, int); for (;;) { \ __ret = prepare_to_wait_event(&wq, &__wait, state); \ if (condition) { \ - __ret = __wait_no_timeout(tout) ?: __tout ?: 1; \ + __ret = __wait_no_timeout(tout); \ + if (!__ret) { \ + __ret = __tout; \ + if (!__ret) \ + __ret = 1; \ + } \ break; \ } \ \ @@ -218,9 +223,14 @@ wait_queue_head_t *bit_waitqueue(void *, int); #define wait_event_common(wq, condition, state, tout) \ ({ \ long __ret; \ - if (condition) \ - __ret = __wait_no_timeout(tout) ?: (tout) ?: 1; \ - else \ + if (condition) { \ + __ret = __wait_no_timeout(tout); \ + if (!__ret) { \ + __ret = (tout); \ + if (!__ret) \ + __ret = 1; \ + } \ + } else \ __ret = __wait_event_common(wq, condition, state, tout);\ __ret; \ }) -- 2.39.5