Skip to contentSkip to conversation

sound/core/pcm_timer.c: use lib/gcd.c

PATCH In review Florian Fainelli 1 participant 1 message Jun 4, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 2/8 sound/core/pcm_timer.c: use lib/gcd.c

This patch makes sound/core/pcm_timer.c use lib/gcd.c

---

sound/core/Kconfig +1 -0
index 7bbdda0..0ae2485 100644
@@ -5,6 +5,7 @@ config SND_TIMER
 config SND_PCM
 	tristate
 	select SND_TIMER
+	select GCD
 
 config SND_HWDEP
 	tristate
sound/core/pcm_timer.c +1 -16
index ca8068b..b01d948 100644
@@ -20,6 +20,7 @@
  */
 
 #include <linux/time.h>
+#include <linux/gcd.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/timer.h>
@@ -28,22 +29,6 @@
  *  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;