diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lcm.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -12,3 +12,14 @@ unsigned long lcm(unsigned long a, unsigned long b) | |||
12 | return 0; | 12 | return 0; |
13 | } | 13 | } |
14 | EXPORT_SYMBOL_GPL(lcm); | 14 | EXPORT_SYMBOL_GPL(lcm); |
15 | |||
16 | unsigned long lcm_not_zero(unsigned long a, unsigned long b) | ||
17 | { | ||
18 | unsigned long l = lcm(a, b); | ||
19 | |||
20 | if (l) | ||
21 | return l; | ||
22 | |||
23 | return (b ? : a); | ||
24 | } | ||
25 | EXPORT_SYMBOL_GPL(lcm_not_zero); | ||