From f3de3b1817493858074db7ed4b3c39cf15b2edce Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Wed, 23 Mar 2016 13:58:59 -0700 Subject: [PATCH] Add DIV_ROUND_UP() to util.h We're going to need this in some upcoming format.h changes. Signed-off-by: Zach Brown --- utils/src/util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utils/src/util.h b/utils/src/util.h index f4dec4f0..daa28a98 100644 --- a/utils/src/util.h +++ b/utils/src/util.h @@ -50,6 +50,8 @@ do { \ ((a) + _b - 1) & ~(_b - 1); \ }) +#define DIV_ROUND_UP(x, y) (((x) + (y) - 1) / (y)) + #ifndef offsetof #define offsetof(type, memb) ((unsigned long)&((type *)0)->memb) #endif