https://jxself.org/git/linux-libre.git
Raw File
Tip revision: d95a24977c75bbb9b26dcbb6203b7a5eed22f10f authored by Jason Self on 05 December 2015, 23:49:20 UTC
Linux-libre 2.6.32.69-gnu1
Tip revision: d95a249
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