2015-02-12 23:03:21 +00:00
|
|
|
#include <linux/compiler.h>
|
2010-03-15 11:46:51 +00:00
|
|
|
#include <linux/gcd.h>
|
2011-11-17 02:29:17 +00:00
|
|
|
#include <linux/export.h>
|
2011-07-26 00:13:20 +00:00
|
|
|
#include <linux/lcm.h>
|
2010-03-15 11:46:51 +00:00
|
|
|
|
|
|
|
/* Lowest common multiple */
|
|
|
|
unsigned long lcm(unsigned long a, unsigned long b)
|
|
|
|
{
|
|
|
|
if (a && b)
|
2014-12-10 23:51:27 +00:00
|
|
|
return (a / gcd(a, b)) * b;
|
2014-12-10 23:51:29 +00:00
|
|
|
else
|
|
|
|
return 0;
|
2010-03-15 11:46:51 +00:00
|
|
|
}
|
|
|
|
EXPORT_SYMBOL_GPL(lcm);
|