macro/align: Fix ALIGN_UP and ALIGN_DOWN

Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
wangmingrong1 2025-01-10 23:21:27 +08:00 committed by Xiang Xiao
parent 558fe83f6d
commit 1d8ce18d7f

View file

@ -48,7 +48,7 @@
#endif
#ifndef ALIGN_UP
# define ALIGN_UP(x,a) (((x) + ((a) - 1)) & ~((a) - 1))
# define ALIGN_UP(x,a) ((((x) + (a) - 1) / (a)) * (a))
#endif
#ifndef ALIGN_UP_MASK
@ -56,7 +56,7 @@
#endif
#ifndef ALIGN_DOWN
# define ALIGN_DOWN(x,a) ((x) & (~((a) - 1)))
# define ALIGN_DOWN(x,a) (((x) / (a)) * (a))
#endif
#ifndef ALIGN_DOWN_MASK