]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blob - include/linux/align.h
Merge tag 'kernel.sys.v5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner...
[mirror_ubuntu-jammy-kernel.git] / include / linux / align.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _LINUX_ALIGN_H
3 #define _LINUX_ALIGN_H
4
5 #include <linux/const.h>
6
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)
14
15 #endif /* _LINUX_ALIGN_H */