[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220425115743.GN2462@kadam>
Date: Mon, 25 Apr 2022 14:57:43 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Colin Ian King <colin.i.king@...il.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
linux-media@...r.kernel.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] media: dvbdev: remove redundant initialization of
variable ret
On Sun, Apr 24, 2022 at 04:47:20PM +0100, Colin Ian King wrote:
> Variable ret is being ininitialized with a value that is never read.
> The ininitializtion is redundant and can be removed. Move the variable
> to the scope it is required.
>
> Signed-off-by: Colin Ian King <colin.i.king@...il.com>
> ---
> drivers/media/dvb-core/dvbdev.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c
> index 675d877a67b2..d5a142ef9876 100644
> --- a/drivers/media/dvb-core/dvbdev.c
> +++ b/drivers/media/dvb-core/dvbdev.c
> @@ -243,7 +243,7 @@ static void dvb_media_device_free(struct dvb_device *dvbdev)
> static int dvb_create_tsout_entity(struct dvb_device *dvbdev,
> const char *name, int npads)
> {
> - int i, ret = 0;
> + int i;
It's better when "ret" has function scope. Otherwise in the future
when someone adds a "ret" you're going to end up with two "ret"
variables.
regards,
dan carpenter
Powered by blists - more mailing lists