[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220302043451.2441320-9-willy@infradead.org>
Date: Wed, 2 Mar 2022 04:34:40 +0000
From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
To: Kees Cook <keescook@...omium.org>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Daniel Bristot de Oliveira <bristot@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@...radead.org>,
linux-kernel@...r.kernel.org
Subject: [PATCH 08/19] wait: Parameterize the return variable to __wait_event_idle_timeout()
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@...radead.org>
---
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 a4a17f3b6871..0f93cfd046bb 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -698,7 +698,7 @@ do { \
___wait_event(wq_head, condition, TASK_IDLE, 1, 0, schedule()); \
} while (0)
-#define __wait_event_idle_timeout(wq_head, condition, timeout) \
+#define __wait_event_idle_timeout(wq_head, condition, timeout, __ret) \
___wait_event(wq_head, ___wait_cond_timeout(condition, __ret), \
TASK_IDLE, 0, timeout, \
__ret = schedule_timeout(__ret))
@@ -722,13 +722,14 @@ do { \
* or the remaining jiffies (at least 1) if the @condition evaluated
* to %true before the @timeout elapsed.
*/
-#define wait_event_idle_timeout(wq_head, condition, timeout) \
-({ \
- long __ret = timeout; \
- might_sleep(); \
- if (!___wait_cond_timeout(condition, __ret)) \
- __ret = __wait_event_idle_timeout(wq_head, condition, timeout); \
- __ret; \
+#define wait_event_idle_timeout(wq_head, condition, timeout) \
+({ \
+ long __ret = timeout; \
+ might_sleep(); \
+ if (!___wait_cond_timeout(condition, __ret)) \
+ __ret = __wait_event_idle_timeout(wq_head, condition, \
+ timeout, __ret); \
+ __ret; \
})
#define __wait_event_idle_exclusive_timeout(wq_head, condition, timeout) \
--
2.34.1
Powered by blists - more mailing lists