Skip to contentSkip to conversation

UBI changes for 2.6.40

GIT PULL Artem Bityutskiy 3 participants 3 messages May 24, 2011 – Jun 22, 2011

lore
Share & tools
lore
#0 lore raw

Hi Linus,

please pull UBI changes.

The following changes since commit a6360dd37e1a144ed11e6548371bade559a1e4df:

Linux 2.6.39-rc3 (2011-04-11 17:21:51 -0700)

are available in the git repository at:
git://git.infradead.org/ubi-2.6.git linux-next

Artem Bityutskiy (9):
UBI: make the control character device non-seekable
UBI: re-name set volume properties ioctl
UBI: cleanup comments around volume properties
UBI: use __packed instead of __attribute__((packed))
UBI: fix minor stylistic issues
UBI: fix typo in a message
UBI: improve checking in debugging prints
UBI: turn some macros into static inline
UBI: switch to dynamic printks

 drivers/mtd/ubi/cdev.c      |   14 ++--
 drivers/mtd/ubi/debug.c     |   21 +++---
 drivers/mtd/ubi/debug.h     |  161 ++++++++++++++++++++++---------------------
 drivers/mtd/ubi/io.c        |    6 +-
 drivers/mtd/ubi/scan.c      |    2 +-
 drivers/mtd/ubi/ubi-media.h |    6 +-
 drivers/mtd/ubi/ubi.h       |    4 +-
 drivers/mtd/ubi/wl.c        |    3 +-
 include/linux/mtd/ubi.h     |    4 +-
 include/mtd/ubi-user.h      |   40 ++++++-----
 10 files changed, 132 insertions(+), 129 deletions(-)

Thanks,
Artem.

#1 lore raw
Quoted 2 lines · Artem Bityutskiy

UBI: use __packed instead of __attribute__((packed))

This patch causes a compile error when I build busybox:

CC miscutils/ubi_attach_detach.o
In file included from miscutils/ubi_attach_detach.c:27:0:
/usr/include/mtd/ubi-user.h:330:3: error: conflicting types for ‘__packed’ /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here /usr/include/mtd/ubi-user.h:372:3: error: conflicting types for ‘__packed’ /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here /usr/include/mtd/ubi-user.h:387:3: error: conflicting types for ‘__packed’ /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here /usr/include/mtd/ubi-user.h:399:3: error: conflicting types for ‘__packed’ /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here /usr/include/mtd/ubi-user.h:413:4: error: conflicting types for ‘__packed’ /usr/include/mtd/ubi-user.h:314:3: note: previous declaration of ‘__packed’ was here make[1]: *** [miscutils/ubi_attach_detach.o] Error 1
make: *** [miscutils] Error 2
make: *** Waiting for unfinished jobs....

Either reverting or using something like this fixes the problem:

include/mtd/ubi-user.h +4 -0
index 3c41097..47a6c21 100644
@@ -23,6 +23,10 @@
 
 #include <linux/types.h>
 
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
 /*
  * UBI device creation (the same as MTD device attachment)
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
Markus
#2 lore raw

Hi Markus,

yes, sorry, this patch was probably a mistake - I just stupidly followed the new trend.

Quoted 1 line · Markus Trippelsdorf

Either reverting or using something like this fixes the problem:

However, I am a bit reluctant to revert it now because this would only hide the issue. And some googling shows that networking people had a similar error in the past and solved it by reverting before the change went upstream.

Quoted 5 lines
include/mtd/ubi-user.h +0 -0
index 3c41097..47a6c21 100644

include/mtd/ubi-user.h line 32

Quoted 10 lines
include/mtd/ubi-user.h +4 -0
@@ -23,6 +23,10 @@
 
 #include <linux/types.h>
 
+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
 /*
  * UBI device creation (the same as MTD device attachment)
  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This would be a dirty hack. I think a better solution is to enhance the "scripts/headers_install.pl" script and teach it to substitute __packed with __attribute__((packed)). Then at "make headers_install" time this issue would be fixed up.

Or may be the definition of __packed has to be somehow included in ubi-user.h ...

Would you please try to make a patch and send it to lkml to hopefully generate some discussion and the right way to go would probably be found?

Signature · 2 lines
Best Regards,
Artem Bityutskiy