lkml.org 
[lkml]   [2022]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 10/19] wait: Parameterize the return variable to __wait_event_killable_timeout()
Date
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@infradead.org>
---
include/linux/wait.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 9089c8bde04b..524e0d1690a4 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -934,9 +934,9 @@ extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
__ret; \
})

-#define __wait_event_killable_timeout(wq_head, condition, timeout) \
- ___wait_event(wq_head, ___wait_cond_timeout(condition, __ret), \
- TASK_KILLABLE, 0, timeout, \
+#define __wait_event_killable_timeout(wq_head, condition, timeout, __ret) \
+ ___wait_event(wq_head, ___wait_cond_timeout(condition, __ret), \
+ TASK_KILLABLE, 0, timeout, \
__ret = schedule_timeout(__ret))

/**
@@ -961,14 +961,14 @@ extern int do_wait_intr_irq(wait_queue_head_t *, wait_queue_entry_t *);
*
* Only kill signals interrupt this process.
*/
-#define wait_event_killable_timeout(wq_head, condition, timeout) \
-({ \
- long __ret = timeout; \
- might_sleep(); \
- if (!___wait_cond_timeout(condition, __ret)) \
- __ret = __wait_event_killable_timeout(wq_head, \
- condition, timeout); \
- __ret; \
+#define wait_event_killable_timeout(wq_head, condition, timeout) \
+({ \
+ long __ret = timeout; \
+ might_sleep(); \
+ if (!___wait_cond_timeout(condition, __ret)) \
+ __ret = __wait_event_killable_timeout(wq_head, \
+ condition, timeout, __ret); \
+ __ret; \
})


--
2.34.1
\
 
 \ /
  Last update: 2022-03-02 05:36    [W:0.105 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site