logo       

[Kernel-janitors] [PATCH] radio/radio-aimslab: replace while/schedule() wit: msg#00281

Subject: [Kernel-janitors] [PATCH] radio/radio-aimslab: replace while/schedule() with msleep()
I would appreciate any comments from the janitors list.

Thanks,
Nish

Applys-to: 2.6.7

Description: Uses msleep() instead of a while-loop and schedule(). Thus
the CPU is given up for the time desired.

Signed-off-by: Nishanth Aravamudan <nacc@xxxxxxxxxx>


--- linux-vanilla/drivers/media/radio/radio-aimslab.c   2004-06-16 
05:19:02.000000000 +0000
+++ linux-dev/drivers/media/radio/radio-aimslab.c       2004-07-02 
21:41:46.000000000 +0000
@@ -63,12 +63,7 @@ static void sleep_delay(long n)
        if(!d)
                udelay(n);
        else
-       {
-               /* Yield CPU time */
-               unsigned long x=jiffies;
-               while((jiffies-x)<=d)
-                       schedule();
-       }
+               msleep(jiffies_to_msecs(d));
 }
 
 static void rt_decvol(void)
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@xxxxxxxxxxxxxx
http://lists.osdl.org/mailman/listinfo/kernel-janitors
<Prev in Thread] Current Thread [Next in Thread>