]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
fix warnings from ?: operator in wait.h
authorStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:52:58 +0000 (16:52 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Jun 2013 06:54:04 +0000 (16:54 +1000)
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
include/linux/wait.h

index 1c08a6c2e2f0af1b116e82ce11b54594ef6896df..f3b793da651f9ea486e589834d7f970ab8f2d228 100644 (file)
@@ -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;                                                          \
 })