From: Colin Ian King <colin.king@canonical.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: 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 10:11:59 +0100 [thread overview]
Message-ID: <de5e07e8-0bc7-efc5-b9cd-c0b26d9f707e@canonical.com> (raw)
In-Reply-To: <20200414085922.GA1163@kadam>
On 14/04/2020 09:59, Dan Carpenter wrote:
> 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.
They are indeed trivial fixes but can allow us to later find real
unassigned variable bugs in the future when new code gets added and does
not set these variables.
Colin
>
> regards,
> dan carpenter
>
prev parent reply other threads:[~2020-04-14 9:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-10 11:39 Colin King
2020-04-11 22:53 ` Ezequiel Garcia
2020-04-14 8:59 ` Dan Carpenter
2020-04-14 9:11 ` Colin Ian King [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=de5e07e8-0bc7-efc5-b9cd-c0b26d9f707e@canonical.com \
--to=colin.king@canonical.com \
--cc=dan.carpenter@oracle.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
all inboxes | Powered by JetHome®