On Sat, 21 Jul 2007 02:04:34 +0300, Samuel Ortiz <[EMAIL PROTECTED]> wrote:
> On Sat, Jul 21, 2007 at 12:04:27AM +0200, Oliver Neukum wrote:

> > > +struct ks959_speedparams {
> > > + __le32 baudrate;                /* baud rate, little endian */
> > > + unsigned int data_bits : 2;     /* data bits - 5 (5..8) */
> > > + unsigned int : 1;
> > > + unsigned int stop_bits : 1;
> > > + unsigned int parity_enable : 1;
> > > + unsigned int parity_type : 1;
> > > + unsigned int : 1;
> > > + unsigned int reset : 1;
> > > + __u8 reserved[3];
> > > +} __attribute__ ((packed));
> > 
> > The attribute is not needed.

> The driver uses sizeof(struct ks959_speedparams) in a couple places in
> the code. If you don't pack it, the size will vary with different
> architectures since it's not 32 bits aligned, so I think this attribute
> is correct.

Oliver is correct, everything is perfectly aligned and the attribute
is unnecessary.

However the question is moot, since the bit fields vary in order.
Bit fields must not be used, and shifts and masks must be used instead.

-- Pete

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to