https://github.com/torvalds/linux
Revision 2d69708f9c08067735672908507894374bebb379 authored by Mauro Carvalho Chehab on 14 June 2018, 13:47:29 UTC, committed by Mauro Carvalho Chehab on 15 June 2018, 21:10:01 UTC
Now that the number of broken refs are smaller, improve the logic
that gets rid of false-positives.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
1 parent e1f319f
Raw File
Tip revision: 2d69708f9c08067735672908507894374bebb379 authored by Mauro Carvalho Chehab on 14 June 2018, 13:47:29 UTC
scripts/documentation-file-ref-check: get rid of false-positives
Tip revision: 2d69708
lcm.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);

unsigned long lcm_not_zero(unsigned long a, unsigned long b)
{
	unsigned long l = lcm(a, b);

	if (l)
		return l;

	return (b ? : a);
}
EXPORT_SYMBOL_GPL(lcm_not_zero);
back to top