Revision 1f0324caefd39985e9fe052fac97da31694db31e authored by Linus Torvalds on 28 January 2011, 02:24:34 UTC, committed by Linus Torvalds on 28 January 2011, 02:24:34 UTC
* 'stable/bug-fixes-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen/setup: Route halt operations to safe_halt pvop.
  xen/e820: Guard against E820_RAM not having page-aligned size or start.
  xen/p2m: Mark INVALID_P2M_ENTRY the mfn_list past max_pfn.
2 parent s 0b6bb66 + 23febed
Raw File
lcm.c
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/module.h>

/* Lowest common multiple */
unsigned long lcm(unsigned long a, unsigned long b)
{
	if (a && b)
		return (a * b) / gcd(a, b);
	else if (b)
		return b;

	return a;
}
EXPORT_SYMBOL_GPL(lcm);
back to top