Revision cdd4e1a76cef22bb0368da7eba6f5a44bccb89b0 authored by Russell King on 18 December 2011, 12:07:09 UTC, committed by Russell King on 25 January 2012, 11:04:03 UTC
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
1 parent cc6e75a
Raw File
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