macro/align: Fix ALIGN_UP and ALIGN_DOWN
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
parent
558fe83f6d
commit
1d8ce18d7f
1 changed files with 2 additions and 2 deletions
|
@ -48,7 +48,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ALIGN_UP
|
#ifndef ALIGN_UP
|
||||||
# define ALIGN_UP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
|
# define ALIGN_UP(x,a) ((((x) + (a) - 1) / (a)) * (a))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ALIGN_UP_MASK
|
#ifndef ALIGN_UP_MASK
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ALIGN_DOWN
|
#ifndef ALIGN_DOWN
|
||||||
# define ALIGN_DOWN(x,a) ((x) & (~((a) - 1)))
|
# define ALIGN_DOWN(x,a) (((x) / (a)) * (a))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ALIGN_DOWN_MASK
|
#ifndef ALIGN_DOWN_MASK
|
||||||
|
|
Loading…
Reference in a new issue