public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: YueHaibing <yuehaibing@huawei.com>
Cc: gregkh@linuxfoundation.org, balbi@kernel.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH -next] usb: gadget: Remove dead branch code
Date: Wed, 6 Mar 2019 02:46:33 +0200	[thread overview]
Message-ID: <20190306004633.GU14928@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20190123143136.15704-1-yuehaibing@huawei.com>

Hello YueHaibing,

Thank you for the patch.

On Wed, Jan 23, 2019 at 10:31:36PM +0800, YueHaibing wrote:
> 'num' is a u8 variable, it never greater than 255,
> So the if branch is dead code and can be removed.
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/usb/gadget/function/uvc_configfs.c | 8 --------
>  1 file changed, 8 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
> index bc1e2af..8fe85cb 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -1570,10 +1570,6 @@ uvcg_uncompressed_##cname##_store(struct config_item *item,		\
>  	if (ret)							\
>  		goto end;						\
>  									\
> -	if (num > 255) {						\
> -		ret = -EINVAL;						\
> -		goto end;						\
> -	}								\
>  	u->desc.aname = num;						\
>  	ret = len;							\
>  end:									\
> @@ -1767,10 +1763,6 @@ uvcg_mjpeg_##cname##_store(struct config_item *item,			\
>  	if (ret)							\
>  		goto end;						\
>  									\
> -	if (num > 255) {						\
> -		ret = -EINVAL;						\
> -		goto end;						\
> -	}								\
>  	u->desc.aname = num;						\
>  	ret = len;							\
>  end:									\

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2019-03-06  0:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 14:31 [PATCH -next] usb: gadget: Remove dead branch code YueHaibing
2019-03-06  0:46 ` Laurent Pinchart [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=20190306004633.GU14928@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=yuehaibing@huawei.com \
    /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