[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <200906011357.09966.florian@openwrt.org>
Date: Mon, 1 Jun 2009 13:57:09 +0200
From: Florian Fainelli <florian@...nwrt.org>
To: linux-kernel@...r.kernel.org, Takashi Iwai <tiwai@...e.de>,
akpm <akpm@...ux-foundation.org>, linux-mips@...ux-mips.org,
Ralf Baechle <ralf@...ux-mips.org>, Ingo Molnar <mingo@...e.hu>
Subject: [PATCH 1/9] kernel: export sound/core/pcm_timer.c gcd implementation
This patch exports the gcd implementation from
sound/core/pcm_timer.c into include/linux/kernel.h.
AR7 uses it in its clock routines.
Signed-off-by: Florian Fainelli <florian@...nwrt.org>
---
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 883cd44..878a27a 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -147,6 +147,22 @@ extern int _cond_resched(void);
(__x < 0) ? -__x : __x; \
})
+/* Greatest common divisor */
+static inline 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;
+}
+
#ifdef CONFIG_PROVE_LOCKING
void might_fault(void);
#else
diff --git a/sound/core/pcm_timer.c b/sound/core/pcm_timer.c
index ca8068b..e9dbf62 100644
--- a/sound/core/pcm_timer.c
+++ b/sound/core/pcm_timer.c
@@ -20,6 +20,7 @@
*/
#include <linux/time.h>
+#include <linux/kernel.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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists