public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: Colin King <colin.king@canonical.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media <linux-media@vger.kernel.org>,
	kernel-janitors@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: mantis: remove redundant assignment to variable err
Date: Tue, 14 Apr 2020 11:59:22 +0300	[thread overview]
Message-ID: <20200414085922.GA1163@kadam> (raw)
In-Reply-To: <CAAEAJfCQaCCoShLPTA+EWUhMXdF6bKAxcOCj2SR5nPXMmk7LQg@mail.gmail.com>

On Sat, Apr 11, 2020 at 07:53:51PM -0300, Ezequiel Garcia wrote:
> 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.

To me that code really looks like a hack-around for flakey hardware and
I would be afraid to delete it.  But the "err =" could be removed.

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

Eventually we would like to enable that warning by default but there are
still thousands of pointless assignments so it will take years of
small fixes like this.  Generally cleaning up warnings is good.

regards,
dan carpenter


  reply	other threads:[~2020-04-14  9:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10 11:39 [PATCH] media: mantis: remove redundant assignment to variable err Colin King
2020-04-11 22:53 ` Ezequiel Garcia
2020-04-14  8:59   ` Dan Carpenter [this message]
2020-04-14  9:11     ` Colin Ian King

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=20200414085922.GA1163@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=colin.king@canonical.com \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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