* [Kernel-janitors] [PATCH] radio/radio-sf16fmi: replace
@ 2004-07-26 22:41 Nishanth Aravamudan
2004-07-26 22:43 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: replace Nishanth Aravamudan
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Nishanth Aravamudan @ 2004-07-26 22:41 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replaced schedule_timeout() with msleep() to guarantee the
task delays the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- linux-vanilla/drivers/media/radio/radio-sf16fmi.c 2004-06-16 05:20:03.000000000 +0000
+++ linux-dev/drivers/media/radio/radio-sf16fmi.c 2004-07-02 20:46:57.000000000 +0000
@@ -89,8 +89,7 @@ static inline int fmi_setfreq(struct fmi
outbits(16, RSF16_ENCODE(freq), myport);
outbits(8, 0xC0, myport);
- current->state = TASK_UNINTERRUPTIBLE;
- schedule_timeout(HZ/7);
+ msleep(143); /* was schedule_timeout(HZ/7) */
up(&lock);
if (dev->curvol) fmi_unmute(myport);
return 0;
@@ -107,8 +106,7 @@ static inline int fmi_getsigstr(struct f
val = dev->curvol ? 0x08 : 0x00; /* unmute/mute */
outb(val, myport);
outb(val | 0x10, myport);
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(HZ/7);
+ msleep(143); /* was schedule_timeout(HZ/7) */
res = (int)inb(myport+1);
outb(val, myport);
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread* [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: replace
2004-07-26 22:41 [Kernel-janitors] [PATCH] radio/radio-sf16fmi: replace Nishanth Aravamudan
@ 2004-07-26 22:43 ` Nishanth Aravamudan
2004-07-27 14:14 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: Mark Hollomon
2004-07-27 17:31 ` Nishanth Aravamudan
2 siblings, 0 replies; 4+ messages in thread
From: Nishanth Aravamudan @ 2004-07-26 22:43 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 670 bytes --]
I would appreciate any comments from the janitors list.
Thanks,
Nish
Applys-to: 2.6.7
Description: Replaced schedule_timeout() with msleep() to guarantee the
task delays the desired time.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- linux-vanilla/drivers/media/radio/radio-sf16fmr2.c 2004-06-16 05:19:22.000000000 +0000
+++ linux-dev/drivers/media/radio/radio-sf16fmr2.c 2004-07-02 21:42:03.000000000 +0000
@@ -62,10 +62,7 @@ static void sleep_delay(unsigned long n)
if (!d)
udelay(n);
else
- {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(d);
- }
+ msleep(jiffies_to_msecs(d));
}
static inline void wait(int n,int port)
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Kernel-janitors] [PATCH] radio/radio-sf16fmr2:
2004-07-26 22:41 [Kernel-janitors] [PATCH] radio/radio-sf16fmi: replace Nishanth Aravamudan
2004-07-26 22:43 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: replace Nishanth Aravamudan
@ 2004-07-27 14:14 ` Mark Hollomon
2004-07-27 17:31 ` Nishanth Aravamudan
2 siblings, 0 replies; 4+ messages in thread
From: Mark Hollomon @ 2004-07-27 14:14 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 934 bytes --]
since sleep_delay is only called once (with the intent to sleep for 110
ms), wouldn't it be better to simply replace the call to sleep_delay
with msleep (and remove sleep_delay)?
Nishanth Aravamudan wrote:
> I would appreciate any comments from the janitors list.
>
> Thanks,
> Nish
>
> Applys-to: 2.6.7
>
> Description: Replaced schedule_timeout() with msleep() to guarantee the
> task delays the desired time.
>
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
>
>
> --- linux-vanilla/drivers/media/radio/radio-sf16fmr2.c 2004-06-16 05:19:22.000000000 +0000
> +++ linux-dev/drivers/media/radio/radio-sf16fmr2.c 2004-07-02 21:42:03.000000000 +0000
> @@ -62,10 +62,7 @@ static void sleep_delay(unsigned long n)
> if (!d)
> udelay(n);
> else
> - {
> - set_current_state(TASK_UNINTERRUPTIBLE);
> - schedule_timeout(d);
> - }
> + msleep(jiffies_to_msecs(d));
> }
--
--------------------------
Mark Hollomon
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [Kernel-janitors] [PATCH] radio/radio-sf16fmr2:
2004-07-26 22:41 [Kernel-janitors] [PATCH] radio/radio-sf16fmi: replace Nishanth Aravamudan
2004-07-26 22:43 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: replace Nishanth Aravamudan
2004-07-27 14:14 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: Mark Hollomon
@ 2004-07-27 17:31 ` Nishanth Aravamudan
2 siblings, 0 replies; 4+ messages in thread
From: Nishanth Aravamudan @ 2004-07-27 17:31 UTC (permalink / raw)
To: kernel-janitors
[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]
On Tue, Jul 27, 2004 at 10:14:49AM -0400, Mark Hollomon wrote:
> since sleep_delay is only called once (with the intent to sleep for 110
> ms), wouldn't it be better to simply replace the call to sleep_delay
> with msleep (and remove sleep_delay)?
I wasn't sure if I should leave the function in, in case someone wanted
to modify the driver later. But, if you think it's ok, find this fix below.
Thanks again, Mark.
-Nish
Applys-to: 2.6.7
Description: Replace single invocation of sleep_delay() with msleep() and
remove definition of sleep_delay().
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- linux-vanilla/drivers/media/radio/radio-sf16fmr2.c 2004-06-15 22:19:22.000000000 -0700
+++ linux-dev/drivers/media/radio/radio-sf16fmr2.c 2004-07-27 10:29:49.000000000 -0700
@@ -55,19 +55,6 @@ static int radio_nr = -1;
#define RSF16_MINFREQ 87*16000
#define RSF16_MAXFREQ 108*16000
-/* from radio-aimslab */
-static void sleep_delay(unsigned long n)
-{
- unsigned d=n/(1000000U/HZ);
- if (!d)
- udelay(n);
- else
- {
- set_current_state(TASK_UNINTERRUPTIBLE);
- schedule_timeout(d);
- }
-}
-
static inline void wait(int n,int port)
{
for (;n;--n) inb(port);
@@ -153,7 +140,7 @@ static int fmr2_setfreq(struct fmr2_devi
fmr2_unmute(port);
/* wait 0.11 sec */
- sleep_delay(110000LU);
+ msleep(110);
/* NOTE if mute this stop radio
you must set freq on unmute */
[-- Attachment #2: Type: text/plain, Size: 167 bytes --]
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-07-27 17:31 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-26 22:41 [Kernel-janitors] [PATCH] radio/radio-sf16fmi: replace Nishanth Aravamudan
2004-07-26 22:43 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: replace Nishanth Aravamudan
2004-07-27 14:14 ` [Kernel-janitors] [PATCH] radio/radio-sf16fmr2: Mark Hollomon
2004-07-27 17:31 ` Nishanth Aravamudan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.