All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Nigel Christian <nigel.l.christian@gmail.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: uvcvideo: Remove unused variable
Date: Mon, 3 May 2021 12:29:24 +0300	[thread overview]
Message-ID: <20210503092924.GO1981@kadam> (raw)
In-Reply-To: <YIyCJoEwdqgqkxYN@fedora>

On Fri, Apr 30, 2021 at 06:18:14PM -0400, Nigel Christian wrote:
> The variable buflen is being assigned a value that is never read,
> which can be removed.
> 
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Nigel Christian <nigel.l.christian@gmail.com>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 9a791d8ef200..370b086c6e22 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -768,7 +768,6 @@ static int uvc_parse_format(struct uvc_device *dev,
>  		format->xfer_func = uvc_xfer_func(buffer[4]);
>  		format->ycbcr_enc = uvc_ycbcr_enc(buffer[5]);
>  
> -		buflen -= buffer[0];
>  		buffer += buffer[0];
>  	}

This is a situation where I think that the unused assignment helps
readability because it shows how buflen and buffer are connected.

regards,
dan carpenter


  reply	other threads:[~2021-05-03  9:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 22:18 [PATCH] media: uvcvideo: Remove unused variable Nigel Christian
2021-05-03  9:29 ` Dan Carpenter [this message]
2021-05-03 10:07   ` Laurent Pinchart

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=20210503092924.GO1981@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nigel.l.christian@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.