[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAEAJfCQaCCoShLPTA+EWUhMXdF6bKAxcOCj2SR5nPXMmk7LQg@mail.gmail.com>
Date: Sat, 11 Apr 2020 19:53:51 -0300
From: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
To: Colin King <colin.king@...onical.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media <linux-media@...r.kernel.org>,
kernel-janitors@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: mantis: remove redundant assignment to variable err
Hi Colin,
Thanks for your patch!
On Fri, 10 Apr 2020 at 08:39, Colin King <colin.king@...onical.com> wrote:
>
> From: Colin Ian King <colin.king@...onical.com>
>
> The variable err is being initialized with a value that is never read
> and it is being updated later with a new value. The initialization is
> redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@...onical.com>
> ---
> drivers/media/pci/mantis/hopper_vp3028.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/pci/mantis/hopper_vp3028.c b/drivers/media/pci/mantis/hopper_vp3028.c
> index 37bd386f3ed8..ce1e8737b14b 100644
> --- a/drivers/media/pci/mantis/hopper_vp3028.c
> +++ b/drivers/media/pci/mantis/hopper_vp3028.c
> @@ -33,7 +33,7 @@ static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
> {
> struct i2c_adapter *adapter = &mantis->adapter;
> struct mantis_hwconfig *config = mantis->hwconfig;
> - int err = 0;
> + int err;
>
> mantis_gpio_set_bits(mantis, config->reset, 0);
> msleep(100);
There's a redundant err assignment right below here,
which you can also get rid of:
- err = mantis_frontend_power(mantis, POWER_ON);
+ mantis_frontend_power(mantis, POWER_ON);
I can't test this, but calling mantis_frontend_power twice
is possibly redundant.
Also, what's the gain from this cleanup? The driver is super
old, and it seems any modern compiler would be oblivious
of the redundant assignment.
Thanks!
Ezequiel
Powered by blists - more mailing lists