diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2010-04-13 05:21:46 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2010-04-13 05:21:46 -0400 |
commit | a79ff731a1b277d0e92d9453bdf374e04cec717a (patch) | |
tree | 56a67498300927fa0f23bcb3771808b960b4c125 /include/linux/kernel.h | |
parent | b660d0485efeff743c72f1be2185832de8477a24 (diff) |
netfilter: xtables: make XT_ALIGN() usable in exported headers by exporting __ALIGN_KERNEL()
XT_ALIGN() was rewritten through ALIGN() by commit 42107f5009da223daa800d6da6904d77297ae829
"netfilter: xtables: symmetric COMPAT_XT_ALIGN definition".
ALIGN() is not exported in userspace headers, which created compile problem for tc(8)
and will create problem for iptables(8).
We can't export generic looking name ALIGN() but we can export less generic
__ALIGN_KERNEL() (suggested by Ben Hutchings).
Google knows nothing about __ALIGN_KERNEL().
COMPAT_XT_ALIGN() changed for symmetry.
Reported-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'include/linux/kernel.h')
-rw-r--r-- | include/linux/kernel.h | 5 |
1 files changed, 3 insertions, 2 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 | ||