lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <de5e07e8-0bc7-efc5-b9cd-c0b26d9f707e@canonical.com>
Date:   Tue, 14 Apr 2020 10:11:59 +0100
From:   Colin Ian King <colin.king@...onical.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
Cc:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-media <linux-media@...r.kernel.org>,
        kernel-janitors@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] media: mantis: remove redundant assignment to variable
 err

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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ