On Thu, 17 Aug 2006, Franck Bui-Huu wrote:
> Hi Alan,
> > char *bus_name; /* stable id (PCI slot_name etc) */
> > + u8 uses_dma; /* Does the host controller use DMA? */
>
> Why using 'u8' (which is likely expanded to an int) ? Can we use a bit field
> instead as defined below ?
>
> > unsigned is_b_host:1; /* true during some HNP roleswitches */
> > unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
It makes more sense if you don't erase one of the lines of the patch.
Here's the correct context:
char *bus_name; /* stable id (PCI slot_name etc) */
+ u8 uses_dma; /* Does the host controller use DMA? */
u8 otg_port; /* 0, or number of OTG/HNP port */
unsigned is_b_host:1; /* true during some HNP roleswitches */
unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */
There was already a u8 field in there; I just added another one next to
it. The two fields together shouldn't use any more space than the one did
before.
A bit field would have worked just as well, and I don't really care one
way or the other. In fact, you could just make it an int and be done with
it -- the wasted bytes wouldn't matter other than aesthetically.
I did it this way because on x86 it's slightly quicker/shorter to test a
u8 than to test a single bit (at least, it used to be -- processors keep
changing and I can't keep up). On other architectures the balance might
swing the other way, but the cost isn't going to be very high no matter
what.
Alan Stern
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel