yann@2736: commit f210735fe2f17a6225432ee3d1239bcf23a8659c yann@2736: Author: Markus Trippelsdorf yann@2736: Date: Fri Jun 24 15:51:00 2011 +0200 yann@2736: yann@2736: headers_install: fix __packed in exported kernel headers yann@2736: yann@2736: checkpatch.pl warns about using __attribute__((packed)) in kernel yann@2736: headers: "__packed is preferred over __attribute__((packed))". If one yann@2736: follows that advice it could cause problems in the exported header yann@2736: files, because the outside world doesn't know about this shortcut. yann@2736: yann@2736: For example busybox will fail to compile: yann@2736: CC miscutils/ubi_attach_detach.o yann@2736: In file included from miscutils/ubi_attach_detach.c:27:0: yann@2736: /usr/include/mtd/ubi-user.h:330:3: error: conflicting types for ‘__packed’ yann@2736: /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here yann@2736: ... yann@2736: yann@2736: Fix the problem by substituting __packed with __attribute__((packed)) in yann@2736: the header_install.pl script. yann@2736: yann@2736: Cc: Artem Bityutskiy yann@2736: CC: Joe Perches yann@2736: Signed-off-by: Markus Trippelsdorf yann@2736: Signed-off-by: Michal Marek yann@2736: yann@2736: diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl yann@2736: index efb3be1..48462be 100644 yann@2736: --- a/scripts/headers_install.pl yann@2736: +++ b/scripts/headers_install.pl yann@2736: @@ -35,6 +35,7 @@ foreach my $file (@files) { yann@2736: $line =~ s/([\s(])__iomem\s/$1/g; yann@2736: $line =~ s/\s__attribute_const__\s/ /g; yann@2736: $line =~ s/\s__attribute_const__$//g; yann@2736: + $line =~ s/\b__packed\b/__attribute__((packed))/g; yann@2736: $line =~ s/^#include //; yann@2736: $line =~ s/(^|\s)(inline)\b/$1__$2__/g; yann@2736: $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;