Re: [PATCH] EHCI: Make ehci_qh structure items all 32bit aligned

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

 



On Fri, 12 Jun 2009 22:44:11 +0800
Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, 12 Jun 2009, Alek Du wrote:
> 
> > Alan,
> > 
> > Could you also give comments to this patch? I think it won't hurt other HCDs.
> > The QH is per EP, so it only wastes a little bytes.
> 
> I count 21 wasted bytes per QH.  That isn't a tremendous number.  But 
> would it be better if you could find another way to pack the data 
> values?
> 
> For instance, suppose you changed
> 
> 	u8			qh_state;
> 
> to
> 
> 	u32			qh_state:8;
> 
> To tell the truth, I don't know if this would be better or worse.  Or 
> if it would even work (gcc might generate an 8-bit access rather than a 
> 32-bit access).

As I tested, this will cause problems if you use &qh->qh_state to get the address:

error: cannot take address of bit-field "qh_state"
--
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