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




_______________________________________________
b43-dev mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/b43-dev

Reply via email to