usbatm cxacru.c,1.18,1.19

Duncan Sands baldrick at free.fr
Fri Mar 4 07:57:33 EST 2005


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.

> -	u32 signature = le16_to_cpu(usb_dev->descriptor.idVendor) |
> -			(le16_to_cpu(usb_dev->descriptor.idProduct) << 16);

That way you don't have to worry about how << interacts with endianness.

Ciao,

Duncan.




More information about the Usbatm mailing list