[RFC][PATCH] bcmai: introduce AI driver

Larry Finger Larry.Finger at lwfinger.net
Tue Apr 5 16:50:10 EDT 2011


On 04/05/2011 03:15 PM, Rafał Miłecki wrote:
>
> I was reading about __packed long time ago and it was a little tricky
> for me. However I don't see anything in mod_devicetable.h using that
> __packed. Why should we?

Packed should only be used for those structs that are read/written by some 
entity other than the main CPU. For example, RX and TX descriptors must be 
packed. Otherwise, you should let the compiler align them any way that it thinks 
might be more efficient. If that requires holes to aligh a 16-bit quantity, let 
it. Of course, it would not make any difference for x86 on this one, but for 
some architectures (ARM, I think is one), the system must do byte accesses for 
all entries in a packed struct, just in case they are unaligned.

Larry






More information about the b43-dev mailing list