mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
457c899653
Add SPDX license identifiers to all files which: - Have no license information of any form - Have EXPORT_.*_SYMBOL_GPL inside which was used in the initial scan/conversion to ignore the file These files fall under the project license, GPL v2 only. The resulting SPDX license identifier is: GPL-2.0-only Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27 lines
482 B
C
27 lines
482 B
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
#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);
|