ALSA: sound/core/pcm_timer.c: use lib/gcd.c
authorFlorian Fainelli <florian@openwrt.org>
Tue, 22 Dec 2009 00:36:10 +0000 (16:36 -0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 22 Dec 2009 07:24:35 +0000 (08:24 +0100)
Make sound/core/pcm_timer.c use lib/gcd.c

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/Kconfig
sound/core/pcm_timer.c

index c15682a2f9dbd743db935ca682be3ba1a669bb63..475455c76610cdd2ac7c227be01babda6ab72bd8 100644 (file)
@@ -5,6 +5,7 @@ config SND_TIMER
 config SND_PCM
        tristate
        select SND_TIMER
+       select GCD
 
 config SND_HWDEP
        tristate
index ca8068b63d6c1bc413d16a2309d7d33fbe378893..b01d9481d632c4245d3403a445e6e641b9b2e2aa 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include <linux/time.h>
+#include <linux/gcd.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/timer.h>
  *  Timer functions
  */
 
-/* Greatest common divisor */
-static unsigned long gcd(unsigned long a, unsigned long b)
-{
-       unsigned long r;
-       if (a < b) {
-               r = a;
-               a = b;
-               b = r;
-       }
-       while ((r = a % b) != 0) {
-               a = b;
-               b = r;
-       }
-       return b;
-}
-
 void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream)
 {
        unsigned long rate, mult, fsize, l, post;