Revision 7813b94a54987571082ff19e9d87eabbfec23b4e authored by Linus Torvalds on 07 August 2011, 16:53:20 UTC, committed by Linus Torvalds on 07 August 2011, 20:42:25 UTC
Al points out that the do_follow_link() helper function really is
misnamed - it's about whether we should try to follow a symlink or not,
not about actually doing the following.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 206b1d0
Raw File
lcm.c
#include <linux/kernel.h>
#include <linux/gcd.h>
#include <linux/module.h>
#include <linux/lcm.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