diff mbox

[OPW,kernel] staging:serqt_usb2: Fix sparse warning restricted __le16 degrades to integer

Message ID 20140304232957.GA3448@himangi-Inspiron-N5110gmail.com
State New, archived
Headers show

Commit Message

HIMANGI SARAOGI March 4, 2014, 11:29 p.m. UTC
This patch fixes the following sparse warning :
drivers/staging/serqt_usb2/serqt_usb2.c:727:40: warning: restricted
__le16 degrades to integer

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
---
 drivers/staging/serqt_usb2/serqt_usb2.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg KH March 7, 2014, 11:21 p.m. UTC | #1
On Wed, Mar 05, 2014 at 04:59:57AM +0530, Himangi Saraogi wrote:
> This patch fixes the following sparse warning :
> drivers/staging/serqt_usb2/serqt_usb2.c:727:40: warning: restricted __le16 degrades to integer
> 
> Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
> Cc: stable <stable@vger.kernel.org>
> ---
>  drivers/staging/serqt_usb2/serqt_usb2.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
> index f0fcbf7..8682269 100644
> --- a/drivers/staging/serqt_usb2/serqt_usb2.c
> +++ b/drivers/staging/serqt_usb2/serqt_usb2.c
> @@ -724,7 +724,7 @@ static int qt_startup(struct usb_serial *serial)
>  		goto startup_error;
>  	}
>  
> -	switch (serial->dev->descriptor.idProduct) {
> +	switch (le16_to_cpu(serial->dev->descriptor.idProduct)) {

This is a real bug, I'll queue it up for the stable kernels as well.

nice,

greg k-h
diff mbox

Patch

diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index f0fcbf7..8682269 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -724,7 +724,7 @@  static int qt_startup(struct usb_serial *serial)
 		goto startup_error;
 	}
 
-	switch (serial->dev->descriptor.idProduct) {
+	switch (le16_to_cpu(serial->dev->descriptor.idProduct)) {
 	case QUATECH_DSU100:
 	case QUATECH_QSU100:
 	case QUATECH_ESU100A: