[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201106192211.01076.arnd@arndb.de>
Date: Sun, 19 Jun 2011 22:11:00 +0200
From: Arnd Bergmann <arnd@...db.de>
To: linux-arm-kernel@...ts.infradead.org
Cc: Alan Stern <stern@...land.harvard.edu>,
Nicolas Pitre <nico@...xnic.net>, gregkh@...e.de,
linux-usb@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>,
Rabin Vincent <rabin@....in>,
Alexander Holler <holler@...oftware.de>
Subject: Re: [PATCH] USB: ehci: use packed,aligned(4) instead of removing the packed attribute
On Sunday 19 June 2011 22:02:23 Arnd Bergmann wrote:
> In this case, we would have to do
>
> struct s {
> char c[2];
> } __packed;
>
> struct t {
> struct s t1;
> unsigned short t2[3] __aligned(2);
> } __packed;
>
> To tell the compiler that t2 is indeed aligned, while struct t
> is packed to include no padding around t.
>
> I actually recently stumbled over code that gets this wrong,
> see
>
> http://git.kernel.org/?p=linux/kernel/git/arnd/playground.git;a=commit;h=284cef173aafd531a708f48e71a9cc7249fc8a98
>
Just to be clear: none of the ehci structures fall into this category.
I would assume that we actually have a few more drivers with this
bug in the kernel, but the patch proposed by Alexander would not
help with this problem, and the EHCI driver is still correct without
__packed.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists