linux-usb: fix the idProduct value to be compatible with current CPU in initializers.c
Subsystems (2)
PATCH 1/1 linux-usb: fix the idProduct value to be compatible with current CPU in initializers.c
From: fangxiaozhi <[email protected]>
1. The idProduct is little endian, so make sure its value to be compatible with the current CPU. Make no break on big endian processors.
--------------------------------------------------------------------
drivers/usb/storage/initializers.c +2 -2
@@ -147,7 +147,7 @@ static int usb_stor_huawei_dongles_pid(sint idProduct; idesc = &us->pusb_intf->cur_altsetting->desc; - idProduct = us->pusb_dev->descriptor.idProduct; + idProduct =le16_to_cpu (us->pusb_dev->descriptor.idProduct);/* The first port is CDROM, * means the dongle in the single port mode, * and a switch command is required to be sent. */
@@ -169,7 +169,7 @@ int usb_stor_huawei_init(struct us_dataint result =0 ;if (usb_stor_huawei_dongles_pid (us)) { -if (us->pusb_dev->descriptor.idProduct >=0x1446 ) +if (le16_to_cpu (us->pusb_dev->descriptor.idProduct) >=0x1446 ) result =usb_stor_huawei_scsi_init (us);else result =usb_stor_huawei_feature_init (us);
Hello.
Quoted 3 lines · On 07-02-2013 11:32, fangxiaozhi 00110321 wrote:
From: fangxiaozhi <[email protected]>
1. The idProduct is little endian, so make sure its value to be compatible with the current CPU. Make no break on big endian processors.
Wrap your lines reasonable at 80 columns at last (better somewht less).
And why "1." here? Where is "2."?
Quoted 2 lines
Signed-off-by fangxiaozhi <[email protected]>--------------------------------------------------------------------
Either use --- tearline, or no tearline at all.
WBR, Sergei