linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Peter Chen <hzpeterchen@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Li Yang <leoli@freescale.com>, Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
Date: Mon, 18 Jul 2016 09:50:23 +0800	[thread overview]
Message-ID: <20160718015023.GA31293@shlinux2> (raw)
In-Reply-To: <20160715111547.GF9258@mwanda>

On Fri, Jul 15, 2016 at 02:15:47PM +0300, Dan Carpenter wrote:
> We can't assign -EINVAL to a u16.
> 
> Fixes: 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller driver')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c
> index 93d28cb..901366f 100644
> --- a/drivers/usb/gadget/udc/fsl_qe_udc.c
> +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c
> @@ -1878,11 +1878,8 @@ static int qe_get_frame(struct usb_gadget *gadget)
>  
>  	tmp = in_be16(&udc->usb_param->frame_n);
>  	if (tmp & 0x8000)
> -		tmp = tmp & 0x07ff;
> -	else
> -		tmp = -EINVAL;
> -
> -	return (int)tmp;
> +		return tmp & 0x07ff;
> +	return -EINVAL;
>  }

Acked-by: Peter Chen <peter.chen@nxp.com>
>  
>  static int fsl_qe_start(struct usb_gadget *gadget,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 

Best Regards,
Peter Chen

      reply	other threads:[~2016-07-18  1:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-15 11:15 [patch] usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame() Dan Carpenter
2016-07-18  1:50 ` Peter Chen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160718015023.GA31293@shlinux2 \
    --to=hzpeterchen@gmail.com \
    --cc=balbi@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=leoli@freescale.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).