linux/generic: commit an upstream kernel 3.0 patch (fixes busubox-1.19.2 build failure)
[openwrt/svn-archive/archive.git] / target / linux / generic / patches-3.0 / 000-upstream-fix-__packed.patch
1 checkpatch.pl warns about using __attribute__((packed)) in kernel
2 headers: "__packed is preferred over __attribute__((packed))". If one
3 follows that advice it could cause problems in the exported header
4 files, because the outside world doesn't know about this shortcut.
5
6 For example busybox will fail to compile:
7 CC miscutils/ubi_attach_detach.o
8 In file included from miscutils/ubi_attach_detach.c:27:0:
9 /usr/include/mtd/ubi-user.h:330:3: error: conflicting types for ‘__packed’
10 /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here
11 ...
12
13 Fix the problem by substituting __packed with __attribute__((packed)) in
14 the header_install.pl script.
15
16 Cc: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
17 CC: Joe Perches <joe@perches.com>
18 Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
19 ---
20 scripts/headers_install.pl | 1 +
21 1 files changed, 1 insertions(+), 0 deletions(-)
22 diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
23 index efb3be1..48462be 100644
24 --- a/scripts/headers_install.pl
25 +++ b/scripts/headers_install.pl
26 @@ -35,6 +35,7 @@ foreach my $file (@files) {
27 $line =~ s/([\s(])__iomem\s/$1/g;
28 $line =~ s/\s__attribute_const__\s/ /g;
29 $line =~ s/\s__attribute_const__$//g;
30 + $line =~ s/\b__packed\b/__attribute__((packed))/g;
31 $line =~ s/^#include <linux\/compiler.h>//;
32 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
33 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;