Re: [PATCH 31/68] uas: Pack iu struct definitions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 16 Nov 2013, Hans de Goede wrote:

> > No, Linux relies on the compiler to pack things like this together and
> > not put padding in, with the __packed__ attribute (don't we have a
> > __packed macro instead of the __attribute__() thing?)
> 
> Yes we've a __packed macro, but the norm in the usb subsys seems to be to use
> __attribute__ ((__packed__)), see include/[uapi/]linux/usb/*.h

That's different.  Things under include/uapi are meant for use by 
userspace programs, so they can't rely on kernel-internal things like 
the __packed macro.

This is also the reason why those .h files always use __u8 or __le16
rather than u8 or le16.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux