https://jxself.org/git/linux-libre.git
Raw File
Tip revision: 60b953de6431dadb609be5440a060a48b156ea3b authored by Jason Self on 01 June 2012, 07:13:44 UTC
Linux-libre 3.0.33-gnu1
Tip revision: 60b953d
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