diff options
author | davidcunado-arm <david.cunado@arm.com> | 2018-01-30 08:59:35 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-30 08:59:35 +0000 |
commit | eefd04b69cedfbdedfe4b2db2b29f466692a4580 (patch) | |
tree | df413bc9fa309ae56d2e6a9c5c5b5295a9246f9a /include | |
parent | e47541ac6ef58b213fd915253e16e6fa1ae3b4a9 (diff) | |
parent | e2aec918d07237e4a6aa185ad2d267750e8f2883 (diff) |
Merge pull request #1235 from jwerner-chromium/JW_udelay
Fix udelay issues that can make duration slightly too short
Diffstat (limited to 'include')
-rw-r--r-- | include/lib/utils_def.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h index bda3b073..ecb261a1 100644 --- a/include/lib/utils_def.h +++ b/include/lib/utils_def.h @@ -24,6 +24,11 @@ */ #define DIV_ROUND_UP_2EVAL(n, d) (((n) + (d) - 1) / (d)) +#define div_round_up(val, div) __extension__ ({ \ + __typeof__(div) _div = (div); \ + ((val) + _div - 1) / _div; \ +}) + #define MIN(x, y) __extension__ ({ \ __typeof__(x) _x = (x); \ __typeof__(y) _y = (y); \ @@ -55,11 +60,6 @@ #define round_down(value, boundary) \ ((value) & ~round_boundary(value, boundary)) -#define div_round_up(val, div) __extension__ ({ \ - __typeof__(div) _div = (div); \ - round_up((val), _div)/_div; \ -}) - /* * Evaluates to 1 if (ptr + inc) overflows, 0 otherwise. * Both arguments must be unsigned pointer values (i.e. uintptr_t). |