public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Colin King <colin.king@canonical.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	linux-pwm@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH][next] pwm: core: remove redundant assignment to pointer pwm
Date: Tue, 6 Jul 2021 19:27:54 +0300	[thread overview]
Message-ID: <YOSEivHTfvhnCgkY@smile.fi.intel.com> (raw)
In-Reply-To: <20210706155820.aiv3q6rxuer7kdco@pengutronix.de>

On Tue, Jul 06, 2021 at 05:58:20PM +0200, Uwe Kleine-König wrote:

> [adding Andy and Rafael to Cc:]

Thanks.

> 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;

I would move it after the next line...

> >  	struct fwnode_reference_args args;

...i.e. here

	struct pwm_device *pwm;

> >  	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")

With or without above comment addressed,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thanks for spotting and fixing this!

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2021-07-06 16:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-06 15:11 [PATCH][next] pwm: core: remove redundant assignment to pointer pwm Colin King
2021-07-06 15:58 ` Uwe Kleine-König
2021-07-06 16:27   ` Andy Shevchenko [this message]

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=YOSEivHTfvhnCgkY@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=colin.king@canonical.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox