Thread (64 messages) flat view 64 messages, 7 authors, 2011-06-29

[PATCH] USB: ehci: use packed, aligned(4) instead of removing the packed attribute

From: arnd@arndb.de (Arnd Bergmann)
Date: 2011-06-20 20:11:05
Also in: lkml

On Monday 20 June 2011 20:39:02 Alan Stern wrote:
On Mon, 20 Jun 2011, Alexander Holler wrote:
quoted
I see it that way: packed is needed to be sure that at least for struct 
ehci_regs there are no padding bytes inbetween the members.
But is it really needed?
No. When the structure is marked packed, it's broken because it relies
on undefined behavior. If it's not packed, there is no problem.
quoted
It might 
work without, but that depends on the compiler (-version, architecture, 
whatever).
Have there ever been any combinations of compiler, version, 
architecture, whatever, that had unwanted padding bytes in this 
structure?
Only on compilers that are not able to build Linux kernels anyway.

	Arnd
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help