Re: need for packed attribute

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

 



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));
	

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux