mirror of
https://github.com/torvalds/linux
synced 2024-11-05 18:23:50 +00:00
6016daed58
We don't need all the stuff kernel.h pulls in; just compiler.h since export.h doesn't do necessary #includes. This removes more than 100 dependencies. Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14 lines
271 B
C
14 lines
271 B
C
#include <linux/compiler.h>
|
|
#include <linux/gcd.h>
|
|
#include <linux/export.h>
|
|
#include <linux/lcm.h>
|
|
|
|
/* Lowest common multiple */
|
|
unsigned long lcm(unsigned long a, unsigned long b)
|
|
{
|
|
if (a && b)
|
|
return (a / gcd(a, b)) * b;
|
|
else
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL_GPL(lcm);
|