Skip to contentSkip to conversation

Fix wait_for_completion_interruptible declaration mismatch

PATCH In review Jeff Dike 2 participants 2 messages Oct 12, 2007 – Oct 22, 2007

lore
Share & tools
lore

Jeff Dike

author
#0 lore raw

PATCH 1/1 Fix wait_for_completion_interruptible declaration mismatch

Without the fastcall, I get a declaration mismatch between the definition here and the declaration in completion.h.

---
 kernel/sched.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched.c +1 -1
Index: linux-2.6.22/kernel/sched.c
===================================================================
@@ -3789,7 +3789,7 @@ wait_for_completion_timeout(struct compl
 }
 EXPORT_SYMBOL(wait_for_completion_timeout);
 
-int __sched wait_for_completion_interruptible(struct completion *x)
+int fastcall __sched wait_for_completion_interruptible(struct completion *x)
 {
 	return wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_INTERRUPTIBLE);
 }
#1 lore raw
Quoted 4 lines · Jeff Dike

Without the fastcall, I get a declaration mismatch between the definition here and the declaration in completion.h.

indeed! Note that i went for the fix below instead - we can just remove all the fastcall attributes from these APIs, they are never used from assembly directly.

Ingo

---------->
Subject: sched: fix fastcall mismatch in completion APIs
From: Ingo Molnar <[email protected]>

Jeff Dike noticed that wait_for_completion_interruptible()'s prototype had a mismatched fastcall.

Fix this by removing the fastcall attributes from all the completion APIs.

---
 include/linux/completion.h |   16 ++++++++--------
 kernel/sched.c             |   10 +++++-----
 2 files changed, 13 insertions(+), 13 deletions(-)
include/linux/completion.h +8 -8
Index: linux/include/linux/completion.h
===================================================================
@@ -42,15 +42,15 @@ static inline void init_completion(struc
 	init_waitqueue_head(&x->wait);
 }
 
-extern void FASTCALL(wait_for_completion(struct completion *));
-extern int FASTCALL(wait_for_completion_interruptible(struct completion *x));
-extern unsigned long FASTCALL(wait_for_completion_timeout(struct completion *x,
-						   unsigned long timeout));
-extern unsigned long FASTCALL(wait_for_completion_interruptible_timeout(
-			struct completion *x, unsigned long timeout));
+extern void wait_for_completion(struct completion *);
+extern int wait_for_completion_interruptible(struct completion *x);
+extern unsigned long wait_for_completion_timeout(struct completion *x,
+						   unsigned long timeout);
+extern unsigned long wait_for_completion_interruptible_timeout(
+			struct completion *x, unsigned long timeout);
 
-extern void FASTCALL(complete(struct completion *));
-extern void FASTCALL(complete_all(struct completion *));
+extern void complete(struct completion *);
+extern void complete_all(struct completion *);
 
 #define INIT_COMPLETION(x)	((x).done = 0)
 
kernel/sched.c +5 -5
Index: linux/kernel/sched.c
===================================================================
@@ -3838,7 +3838,7 @@ __wake_up_sync(wait_queue_head_t *q, uns
 }
 EXPORT_SYMBOL_GPL(__wake_up_sync);	/* For internal use only */
 
-void fastcall complete(struct completion *x)
+void complete(struct completion *x)
 {
 	unsigned long flags;
 
@@ -3850,7 +3850,7 @@ void fastcall complete(struct completion
 }
 EXPORT_SYMBOL(complete);
 
-void fastcall complete_all(struct completion *x)
+void complete_all(struct completion *x)
 {
 	unsigned long flags;
 
@@ -3902,13 +3902,13 @@ wait_for_common(struct completion *x, lo
 	return timeout;
 }
 
-void fastcall __sched wait_for_completion(struct completion *x)
+void __sched wait_for_completion(struct completion *x)
 {
 	wait_for_common(x, MAX_SCHEDULE_TIMEOUT, TASK_UNINTERRUPTIBLE);
 }
 EXPORT_SYMBOL(wait_for_completion);
 
-unsigned long fastcall __sched
+unsigned long __sched
 wait_for_completion_timeout(struct completion *x, unsigned long timeout)
 {
 	return wait_for_common(x, timeout, TASK_UNINTERRUPTIBLE);
@@ -3924,7 +3924,7 @@ int __sched wait_for_completion_interrup
 }
 EXPORT_SYMBOL(wait_for_completion_interruptible);
 
-unsigned long fastcall __sched
+unsigned long __sched
 wait_for_completion_interruptible_timeout(struct completion *x,
 					  unsigned long timeout)
 {