diff options
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 9fb1c1299032..fc33af911852 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -4,6 +4,8 @@ | |||
4 | /* | 4 | /* |
5 | * 'kernel.h' contains some often-used function prototypes etc | 5 | * 'kernel.h' contains some often-used function prototypes etc |
6 | */ | 6 | */ |
7 | #define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1) | ||
8 | #define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask)) | ||
7 | 9 | ||
8 | #ifdef __KERNEL__ | 10 | #ifdef __KERNEL__ |
9 | 11 | ||
@@ -37,8 +39,8 @@ extern const char linux_proc_banner[]; | |||
37 | 39 | ||
38 | #define STACK_MAGIC 0xdeadbeef | 40 | #define STACK_MAGIC 0xdeadbeef |
39 | 41 | ||
40 | #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) | 42 | #define ALIGN(x, a) __ALIGN_KERNEL((x), (a)) |
41 | #define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) | 43 | #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask)) |
42 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) | 44 | #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) |
43 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) | 45 | #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) |
44 | 46 | ||