diff options
| author | Mark Brown <broonie@kernel.org> | 2015-06-09 18:35:46 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2015-06-09 18:35:46 +0100 |
| commit | 6724af486903df57338c14424e02599e371cf563 (patch) | |
| tree | 0e42ae32bbfe7e93ba9db11a1124aeb4378cbd71 /include/linux/kernel.h | |
| parent | d2233325e5b7891914901867ca5355347d59df14 (diff) | |
| parent | 9deef024a12ebae4965c89837f662905ac88944b (diff) | |
Merge branch 'fix/fsl-dspi' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-fsl-dspi
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index d6d630d31ef3..3a5b48e52a9e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -103,6 +103,18 @@ (((__x) - ((__d) / 2)) / (__d)); \ } \ ) +/* + * Same as above but for u64 dividends. divisor must be a 32-bit + * number. + */ +#define DIV_ROUND_CLOSEST_ULL(x, divisor)( \ +{ \ + typeof(divisor) __d = divisor; \ + unsigned long long _tmp = (x) + (__d) / 2; \ + do_div(_tmp, __d); \ + _tmp; \ +} \ +) /* * Multiplies an integer by a fraction, while avoiding unnecessary |
