[PATCH] include: completion.h: Convert the rest of the dummy functions to macros

Tom Rini trini at konsulko.com
Fri Sep 26 17:31:28 CEST 2025


While we declare some of our dummy functions as "inline" we do not also
declare them as "static" and so it is possible for the compiler to
decide to make these as global functions instead. This can lead to link
time failures in some cases, such as "allyesconfig". As these are just
dummy functions, convert them to a macro instead.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
 include/linux/completion.h | 44 +++++++-------------------------------
 1 file changed, 8 insertions(+), 36 deletions(-)

diff --git a/include/linux/completion.h b/include/linux/completion.h
index 9835826d285e..d99ac450e8cd 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -129,42 +129,14 @@ extern void complete_all(struct completion *);
 #define wait_for_completion(x)		do {} while (0)
 #define wait_for_completion_io(x)	do {} while (0)
 
-inline int wait_for_completion_interruptible(struct completion *x)
-{
-	return 1;
-}
-inline int wait_for_completion_killable(struct completion *x)
-{
-	return 1;
-}
-inline unsigned long wait_for_completion_timeout(struct completion *x,
-						 unsigned long timeout)
-{
-	return 1;
-}
-inline unsigned long wait_for_completion_io_timeout(struct completion *x,
-						    unsigned long timeout)
-{
-	return 1;
-}
-inline long wait_for_completion_interruptible_timeout(struct completion *x,
-						      unsigned long timeout)
-{
-	return 1;
-}
-inline long wait_for_completion_killable_timeout(struct completion *x,
-						 unsigned long timeout)
-{
-	return 1;
-}
-inline bool try_wait_for_completion(struct completion *x)
-{
-	return 1;
-}
-inline bool completion_done(struct completion *x)
-{
-	return 1;
-}
+#define wait_for_completion_interruptible(x)			1
+#define wait_for_completion_killable(x)				1
+#define wait_for_completion_timeout(x, timeout)			1
+#define wait_for_completion_io_timeout(x, timeout)		1
+#define wait_for_completion_interruptible_timeout(x, timeout)	1
+#define wait_for_completion_killable_timeout(x, timeout)	1
+#define try_wait_for_completion(x)				1
+#define completion_done(x)					1
 
 #define complete(x)		do {} while (0)
 #define complete_all(x)		do {} while (0)
-- 
2.43.0



More information about the U-Boot mailing list