[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200402141510.yrjqhmccz6xjaknv@pengutronix.de>
Date: Thu, 2 Apr 2020 16:15:10 +0200
From: Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>
To: Colin King <colin.king@...onical.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Kevin Hilman <khilman@...libre.com>, linux-pwm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-amlogic@...ts.infradead.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org,
Neil Armstrong <narmstrong@...libre.com>
Subject: Re: [PATCH] pwm: meson: remove redundant assignment to variable
fin_freq
On Thu, Apr 02, 2020 at 12:08:57PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@...onical.com>
>
> The variable fin_freq 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>
This was introduced in 211ed630753d ("pwm: Add support for Meson PWM
Controller"), adding Neil To Cc:.
I don't think this was added to cope for a compiler not being able to
see the variable is used initialized only.
Acked-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Thanks
Uwe
> diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c
> index 8cf9129caa39..bd0d7336b898 100644
> --- a/drivers/pwm/pwm-meson.c
> +++ b/drivers/pwm/pwm-meson.c
> @@ -163,7 +163,7 @@ static int meson_pwm_calc(struct meson_pwm *meson, struct pwm_device *pwm,
> {
> struct meson_pwm_channel *channel = pwm_get_chip_data(pwm);
> unsigned int duty, period, pre_div, cnt, duty_cnt;
> - unsigned long fin_freq = -1;
> + unsigned long fin_freq;
>
> duty = state->duty_cycle;
> period = state->period;
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Powered by blists - more mailing lists