mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-13 03:15:06 +00:00
Merge pull request #1235 from jwerner-chromium/JW_udelay
Fix udelay issues that can make duration slightly too short
This commit is contained in:
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user