aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/kernel.h5
-rw-r--r--include/linux/netfilter/x_tables.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7f0707463360..284ea995646e 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,7 @@ 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))
42#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 43#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
43#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 44#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
44 45
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 1a65d45ee4f5..26ced0c323a5 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -1,6 +1,6 @@
1#ifndef _X_TABLES_H 1#ifndef _X_TABLES_H
2#define _X_TABLES_H 2#define _X_TABLES_H
3 3#include <linux/kernel.h>
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define XT_FUNCTION_MAXNAMELEN 30 6#define XT_FUNCTION_MAXNAMELEN 30
@@ -93,7 +93,7 @@ struct _xt_align {
93 __u64 u64; 93 __u64 u64;
94}; 94};
95 95
96#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) 96#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
97 97
98/* Standard return verdict, or do jump. */ 98/* Standard return verdict, or do jump. */
99#define XT_STANDARD_TARGET "" 99#define XT_STANDARD_TARGET ""
@@ -603,7 +603,7 @@ struct _compat_xt_align {
603 compat_u64 u64; 603 compat_u64 u64;
604}; 604};
605 605
606#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) 606#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
607 607
608extern void xt_compat_lock(u_int8_t af); 608extern void xt_compat_lock(u_int8_t af);
609extern void xt_compat_unlock(u_int8_t af); 609extern void xt_compat_unlock(u_int8_t af);