hv: lib: add max()/min() API

Add max()/min() lib API

Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li, Fei1 2018-04-19 16:16:42 +08:00 committed by Jack Ren
parent 7f4332f539
commit ab97963088
1 changed files with 4 additions and 0 deletions

View File

@ -56,4 +56,8 @@
/** Roundup (x/y) to ( x/y + (x%y) ? 1 : 0) **/ /** Roundup (x/y) to ( x/y + (x%y) ? 1 : 0) **/
#define INT_DIV_ROUNDUP(x, y) (((x)+(y)-1)/(y)) #define INT_DIV_ROUNDUP(x, y) (((x)+(y)-1)/(y))
#define min(x, y) ((x) < (y)) ? (x) : (y)
#define max(x, y) ((x) < (y)) ? (y) : (x)
#endif /* UTIL_H */ #endif /* UTIL_H */