1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/const.h>
7 /* @a is a power of 2 value */
8 #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
9 #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
10 #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
11 #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
12 #define PTR_ALIGN_DOWN(p, a) ((typeof(p))ALIGN_DOWN((unsigned long)(p), (a)))
13 #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
15 #endif /* _LINUX_ALIGN_H */