[PATCH 12/19] wait_bit: Parameterize the return variable to __wait_var_event_timeout()

From: Matthew Wilcox (Oracle)
Date: Tue Mar 01 2022 - 23:35:35 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_bit.h | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h
index 227e6a20a978..46744e5e7d61 100644
--- a/include/linux/wait_bit.h
+++ b/include/linux/wait_bit.h
@@ -291,7 +291,7 @@ do { \
__ret; \
})

-#define __wait_var_event_timeout(var, condition, timeout) \
+#define __wait_var_event_timeout(var, condition, timeout, __ret) \
___wait_var_event(var, ___wait_cond_timeout(condition, __ret), \
TASK_UNINTERRUPTIBLE, 0, timeout, \
__ret = schedule_timeout(__ret))
@@ -301,7 +301,8 @@ do { \
long __ret = timeout; \
might_sleep(); \
if (!___wait_cond_timeout(condition, __ret)) \
- __ret = __wait_var_event_timeout(var, condition, timeout); \
+ __ret = __wait_var_event_timeout(var, condition, \
+ timeout, __ret); \
__ret; \
})

--
2.34.1