On Fri, 6 Jan 2006, Oliver Neukum wrote: > Am Freitag, 6. Januar 2006 19:38 schrieb Russell King: > > On Fri, Jan 06, 2006 at 07:15:43PM +0100, Oliver Neukum wrote: > > > Hi, > > > > > > is there any architecture for which packed is required in structures like > > > this: > > > > > > /* All standard descriptors have these 2 fields at the beginning */ > > > struct usb_descriptor_header { > > > __u8 bLength; > > > __u8 bDescriptorType; > > > }; > > > > sizeof(struct usb_descriptor_header) will be 4 on ARM. If this > > concerns you, you need to pack the structure thusly: > > > > struct usb_descriptor_header { > > __u8 bLength; > > __u8 bDescriptorType; > > } __attribute__((packed)); > > I had feared so. The usb include files are incorrect for arm in this case. > Did I overdo it?
Perhaps you are overreacting. Even though the total size of the structure may be 4, I bet that bLength and bDescriptorType still occupy just the first two bytes of the structure. Assuming this is so, there's nothing wrong with the existing headers. Alan Stern ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel