2011-05-24 06:38:46

by Artem Bityutskiy

[permalink] [raw]
Subject: [GIT PULL] UBI changes for 2.6.40

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.


2011-06-12 06:40:07

by Markus Trippelsdorf

[permalink] [raw]
Subject: Re: [GIT PULL] UBI changes for 2.6.40

On 2011.05.24 at 09:41 +0300, Artem Bityutskiy wrote:
>
> 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:

diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
index 3c41097..47a6c21 100644
--- a/include/mtd/ubi-user.h
+++ b/include/mtd/ubi-user.h
@@ -23,6 +23,10 @@

#include <linux/types.h>

+#ifndef __packed
+#define __packed __attribute__((packed))
+#endif
+
/*
* UBI device creation (the same as MTD device attachment)
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


--
Markus

2011-06-22 04:30:30

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [GIT PULL] UBI changes for 2.6.40

Hi Markus,

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

On Sun, 2011-06-12 at 08:40 +0200, Markus Trippelsdorf wrote:
> 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.

> diff --git a/include/mtd/ubi-user.h b/include/mtd/ubi-user.h
> index 3c41097..47a6c21 100644
> --- a/include/mtd/ubi-user.h
> +++ b/include/mtd/ubi-user.h
> @@ -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?

--
Best Regards,
Artem Bityutskiy