[PATCH 09/19] wait: Parameterize the return variable to __wait_event_idle_exclusive_timeout()

From: Matthew Wilcox (Oracle)
Date: Tue Mar 01 2022 - 23:35:40 EST


Macros should not refer to variables which aren't in their arguments.
Pass the name from its caller.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
include/linux/wait.h | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 0f93cfd046bb..9089c8bde04b 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -732,7 +732,7 @@ do { \
__ret; \
})

-#define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
+#define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout, __ret) \
___wait_event(wq_head, ___wait_cond_timeout(condition, __ret), \
TASK_IDLE, 1, timeout, \
__ret = schedule_timeout(__ret))
@@ -760,13 +760,14 @@ do { \
* or the remaining jiffies (at least 1) if the @condition evaluated
* to %true before the @timeout elapsed.
*/
-#define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
-({ \
- long __ret = timeout; \
- might_sleep(); \
- if (!___wait_cond_timeout(condition, __ret)) \
- __ret = __wait_event_idle_exclusive_timeout(wq_head, condition, timeout);\
- __ret; \
+#define wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
+({ \
+ long __ret = timeout; \
+ might_sleep(); \
+ if (!___wait_cond_timeout(condition, __ret)) \
+ __ret = __wait_event_idle_exclusive_timeout(wq_head, \
+ condition, timeout, __ret); \
+ __ret; \
})

extern int do_wait_intr(wait_queue_head_t *, wait_queue_entry_t *);
--
2.34.1