diff options
| author | Takashi Iwai <tiwai@suse.de> | 2012-09-22 18:31:08 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2012-09-22 18:31:08 +0200 |
| commit | 3d98c21d064bfbb8c6fddc659471acb4950320fa (patch) | |
| tree | a506fbe4cca3616f328cdf761a45d0a09ce38237 /include/linux/kernel.h | |
| parent | 99df18b31db389ec6abc8ad5415c14e7bb752b58 (diff) | |
| parent | ddfb43f3881edb47aa0083651ad31983cdc42c33 (diff) | |
Merge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v3.7
Lots and lots of driver specific cleanups and enhancements but the only
substantial framework feature this time round is the compressed API
binding:
- Addition of ASoC bindings for the compressed API, used by the mid-x86
drivers.
- Lots of cleanups and API refreshes for CODEC drivers and DaVinci.
- Conversion of OMAP to dmaengine.
- New machine driver for Wolfson Microelectronics Bells.
- New CODEC driver for Wolfson Microelectronics WM0010.
Diffstat (limited to 'include/linux/kernel.h')
| -rw-r--r-- | include/linux/kernel.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 604382143bcf..594b419b7d20 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -82,10 +82,18 @@ __x - (__x % (y)); \ } \ ) + +/* + * Divide positive or negative dividend by positive divisor and round + * to closest integer. Result is undefined for negative divisors. + */ #define DIV_ROUND_CLOSEST(x, divisor)( \ { \ - typeof(divisor) __divisor = divisor; \ - (((x) + ((__divisor) / 2)) / (__divisor)); \ + typeof(x) __x = x; \ + typeof(divisor) __d = divisor; \ + (((typeof(x))-1) >= 0 || (__x) >= 0) ? \ + (((__x) + ((__d) / 2)) / (__d)) : \ + (((__x) - ((__d) / 2)) / (__d)); \ } \ ) |
