diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-03 17:49:26 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-03 17:49:26 -0400 |
| commit | 57a9d89dc093d86920748fa706fd55f4fcd2399a (patch) | |
| tree | 9f0e1fe5ffb42713f381739d0140e8ae677375e3 /lib/lcm.c | |
| parent | 567cfea99af61ef19da42f8491da98cf94a4d166 (diff) | |
| parent | e9637415a92cf25ad800b7fdeddcd30cce7b44ab (diff) | |
Merge branch 'for-linus' of git://git.kernel.dk/linux-block
Pull block layer fix from Jens Axboe:
"Just one patch in this pull request, fixing a regression caused by a
'mathematically correct' change to lcm()"
* 'for-linus' of git://git.kernel.dk/linux-block:
block: fix blk_stack_limits() regression due to lcm() change
Diffstat (limited to 'lib/lcm.c')
| -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); | ||
