public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] oss: au1550_ac97: simplify au1550_delay()
@ 2010-07-26  8:28 Kulikov Vasiliy
  2010-07-26  8:35 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Kulikov Vasiliy @ 2010-07-26  8:28 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Jaroslav Kysela, Takashi Iwai, Ralf Baechle, Manuel Lauss,
	Arnd Bergmann, linux-kernel, alsa-devel

au1550_delay() uses loop with schedule_timeout() to unconditionally wait
for msec. Use schedule_timeout_uninteruptible() instead.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
---
 sound/oss/au1550_ac97.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c
index 0fd256c..c4a4cdc 100644
--- a/sound/oss/au1550_ac97.c
+++ b/sound/oss/au1550_ac97.c
@@ -163,19 +163,10 @@ ld2(unsigned int x)
 static void
 au1550_delay(int msec)
 {
-	unsigned long   tmo;
-	signed long     tmo2;
-
 	if (in_interrupt())
 		return;
 
-	tmo = jiffies + (msec * HZ) / 1000;
-	for (;;) {
-		tmo2 = tmo - jiffies;
-		if (tmo2 <= 0)
-			break;
-		schedule_timeout(tmo2);
-	}
+	schedule_timeout_uninterruptible(msecs_to_jiffies(msec));
 }
 
 static u16
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] oss: au1550_ac97: simplify au1550_delay()
  2010-07-26  8:28 [PATCH] oss: au1550_ac97: simplify au1550_delay() Kulikov Vasiliy
@ 2010-07-26  8:35 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2010-07-26  8:35 UTC (permalink / raw)
  To: Kulikov Vasiliy
  Cc: kernel-janitors, Jaroslav Kysela, Ralf Baechle, Manuel Lauss,
	Arnd Bergmann, linux-kernel, alsa-devel

At Mon, 26 Jul 2010 12:28:32 +0400,
Kulikov Vasiliy wrote:
> 
> au1550_delay() uses loop with schedule_timeout() to unconditionally wait
> for msec. Use schedule_timeout_uninteruptible() instead.
> 
> Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>

Thanks, applied both patches.


Takashi

> ---
>  sound/oss/au1550_ac97.c |   11 +----------
>  1 files changed, 1 insertions(+), 10 deletions(-)
> 
> diff --git a/sound/oss/au1550_ac97.c b/sound/oss/au1550_ac97.c
> index 0fd256c..c4a4cdc 100644
> --- a/sound/oss/au1550_ac97.c
> +++ b/sound/oss/au1550_ac97.c
> @@ -163,19 +163,10 @@ ld2(unsigned int x)
>  static void
>  au1550_delay(int msec)
>  {
> -	unsigned long   tmo;
> -	signed long     tmo2;
> -
>  	if (in_interrupt())
>  		return;
>  
> -	tmo = jiffies + (msec * HZ) / 1000;
> -	for (;;) {
> -		tmo2 = tmo - jiffies;
> -		if (tmo2 <= 0)
> -			break;
> -		schedule_timeout(tmo2);
> -	}
> +	schedule_timeout_uninterruptible(msecs_to_jiffies(msec));
>  }
>  
>  static u16
> -- 
> 1.7.0.4
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-07-26  8:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-26  8:28 [PATCH] oss: au1550_ac97: simplify au1550_delay() Kulikov Vasiliy
2010-07-26  8:35 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox