[PATCH] deprecate sleep_on()

From: Arnd Bergmann
Date: Sat Nov 13 2004 - 12:46:49 EST


The use of sleep_on() and related functions has been discouraged
since before 2.4.0. Marking the calls deprecated hopefully
helps us phasing out the few remaining users. With this patch
we get eight new warnings in i386 defconfig, most of which
are about code that looks suspicious.

With i386 allmodconfig, I get new warnings in a total of 81 files,
mostly obscure device drivers.

===== include/linux/wait.h 1.27 vs edited =====
--- 1.27/include/linux/wait.h Tue Oct 19 11:40:20 2004
+++ edited/include/linux/wait.h Sun Nov 7 16:26:13 2004
@@ -304,12 +304,35 @@
* They are racy. DO NOT use them, use the wait_event* interfaces above.
* We plan to remove these interfaces during 2.7.
*/
-extern void FASTCALL(sleep_on(wait_queue_head_t *q));
-extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q,
- signed long timeout));
-extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q));
-extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q,
- signed long timeout));
+void FASTCALL(__sleep_on(wait_queue_head_t *q));
+long FASTCALL(__sleep_on_timeout(wait_queue_head_t *q, signed long timeout));
+void FASTCALL(__interruptible_sleep_on(wait_queue_head_t *q));
+long FASTCALL(__interruptible_sleep_on_timeout(wait_queue_head_t *q,
+ signed long timeout));
+
+static inline void __deprecated
+sleep_on(wait_queue_head_t *q)
+{
+ return __sleep_on(q);
+}
+
+static inline long __deprecated
+sleep_on_timeout(wait_queue_head_t *q, signed long timeout)
+{
+ return __sleep_on_timeout(q, timeout);
+}
+
+static inline void __deprecated
+interruptible_sleep_on(wait_queue_head_t *q)
+{
+ return __interruptible_sleep_on(q);
+}
+
+static inline long __deprecated
+interruptible_sleep_on_timeout(wait_queue_head_t *q, signed long timeout)
+{
+ return __interruptible_sleep_on_timeout(q, timeout);
+}

/*
* Waitqueues which are removed from the waitqueue_head at wakeup time
===== kernel/sched.c 1.377 vs edited =====
--- 1.377/kernel/sched.c Sun Oct 31 17:38:43 2004
+++ edited/kernel/sched.c Sun Nov 7 16:28:40 2004
@@ -2867,7 +2867,7 @@
__remove_wait_queue(q, &wait); \
spin_unlock_irqrestore(&q->lock, flags);

-void fastcall __sched interruptible_sleep_on(wait_queue_head_t *q)
+void fastcall __sched __interruptible_sleep_on(wait_queue_head_t *q)
{
SLEEP_ON_VAR

@@ -2878,9 +2878,10 @@
SLEEP_ON_TAIL
}

-EXPORT_SYMBOL(interruptible_sleep_on);
+EXPORT_SYMBOL(__interruptible_sleep_on);

-long fastcall __sched interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout)
+long fastcall __sched
+__interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout)
{
SLEEP_ON_VAR

@@ -2893,9 +2894,9 @@
return timeout;
}

-EXPORT_SYMBOL(interruptible_sleep_on_timeout);
+EXPORT_SYMBOL(__interruptible_sleep_on_timeout);

-void fastcall __sched sleep_on(wait_queue_head_t *q)
+void fastcall __sched __sleep_on(wait_queue_head_t *q)
{
SLEEP_ON_VAR

@@ -2906,9 +2907,9 @@
SLEEP_ON_TAIL
}

-EXPORT_SYMBOL(sleep_on);
+EXPORT_SYMBOL(__sleep_on);

-long fastcall __sched sleep_on_timeout(wait_queue_head_t *q, long timeout)
+long fastcall __sched __sleep_on_timeout(wait_queue_head_t *q, long timeout)
{
SLEEP_ON_VAR

@@ -2921,7 +2922,7 @@
return timeout;
}

-EXPORT_SYMBOL(sleep_on_timeout);
+EXPORT_SYMBOL(__sleep_on_timeout);

void set_user_nice(task_t *p, long nice)
{

Attachment: pgp00000.pgp
Description: signature