usbatm cxacru.c,1.18,1.19

Roman Kagan rkagan at mail.ru
Fri Mar 4 08:56:35 EST 2005


On Fri, Mar 04, 2005 at 01:57:33PM +0100, Duncan Sands wrote:
> I think it would be wiser to define a struct with two 16 bit fields:
> 
> struct signature_struct {
> 	__le16 idVendor;
> 	__le16 idProduct;
> } __attribute__ ((packed));
> 
> and just write idVendor and idProduct into it.

Is the way I did it:

> +	u16 signature[] = { usb_dev->descriptor.idVendor, usb_dev->descriptor.idProduct };

worse than what you suggest?  No bit-shift operators anymore.

Roman.



More information about the Usbatm mailing list