lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220302043451.2441320-12-willy@infradead.org>
Date:   Wed,  2 Mar 2022 04:34:43 +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 11/19] wait: Parameterize the return variable to __wait_event_lock_irq_timeout()

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

Signed-off-by: Matthew Wilcox (Oracle) <willy@...radead.org>
---
 include/linux/wait.h | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/linux/wait.h b/include/linux/wait.h
index 524e0d1690a4..757285a04c88 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -1109,7 +1109,7 @@ do {										\
 	__ret;									\
 })
 
-#define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state)	\
+#define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state, __ret)	\
 	___wait_event(wq_head, ___wait_cond_timeout(condition, __ret),		\
 		      state, 0, timeout,					\
 		      spin_unlock_irq(&lock);					\
@@ -1140,25 +1140,25 @@ do {										\
  * was interrupted by a signal, and the remaining jiffies otherwise
  * if the condition evaluated to true before the timeout elapsed.
  */
-#define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock,	\
-						  timeout)			\
-({										\
-	long __ret = timeout;							\
-	if (!___wait_cond_timeout(condition, __ret))				\
-		__ret = __wait_event_lock_irq_timeout(				\
-					wq_head, condition, lock, timeout,	\
-					TASK_INTERRUPTIBLE);			\
-	__ret;									\
+#define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \
+						  timeout)		\
+({									\
+	long __ret = timeout;						\
+	if (!___wait_cond_timeout(condition, __ret))			\
+		__ret = __wait_event_lock_irq_timeout(			\
+					wq_head, condition, lock, timeout, \
+					TASK_INTERRUPTIBLE, __ret);	\
+	__ret;								\
 })
 
-#define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout)		\
-({										\
-	long __ret = timeout;							\
-	if (!___wait_cond_timeout(condition, __ret))				\
-		__ret = __wait_event_lock_irq_timeout(				\
-					wq_head, condition, lock, timeout,	\
-					TASK_UNINTERRUPTIBLE);			\
-	__ret;									\
+#define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout)	\
+({									\
+	long __ret = timeout;						\
+	if (!___wait_cond_timeout(condition, __ret))			\
+		__ret = __wait_event_lock_irq_timeout(			\
+					wq_head, condition, lock, timeout, \
+					TASK_UNINTERRUPTIBLE, __ret);	\
+	__ret;								\
 })
 
 /*
-- 
2.34.1

Powered by blists - more mailing lists