https://jxself.org/git/linux-libre.git
Raw File
Tip revision: 88583a11f7ef97b039ee7239b86389e76472ba6b authored by Jason Self on 10 August 2010, 18:02:09 UTC
Linux-libre 2.6.34.3-gnu1
Tip revision: 88583a1
gcd.c
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/module.h>

/* Greatest common divisor */
unsigned long gcd(unsigned long a, unsigned long b)
{
	unsigned long r;

	if (a < b)
		swap(a, b);
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
EXPORT_SYMBOL_GPL(gcd);
back to top