lkml.org 
[lkml]   [2021]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][next] pwm: core: remove redundant assignment to pointer pwm
Hello,

[adding Andy and Rafael to Cc:]

On Tue, Jul 06, 2021 at 04:11:32PM +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer pwm 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@canonical.com>
> ---
> drivers/pwm/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pwm/core.c b/drivers/pwm/core.c
> index a28c8639af5b..35e894f4a379 100644
> --- a/drivers/pwm/core.c
> +++ b/drivers/pwm/core.c
> @@ -846,7 +846,7 @@ EXPORT_SYMBOL_GPL(of_pwm_get);
> */
> static struct pwm_device *acpi_pwm_get(const struct fwnode_handle *fwnode)
> {
> - struct pwm_device *pwm = ERR_PTR(-ENODEV);
> + struct pwm_device *pwm;
> struct fwnode_reference_args args;
> struct pwm_chip *chip;
> int ret;

LGTM:

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

and if you want:

Fixes: e5c38ba9f281 ("pwm: core: Reuse fwnode_to_pwmchip() in ACPI case")

Best regards
Uwe

--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-07-06 17:58    [W:0.038 / U:1.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site