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] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Sep 2022 08:58:47 +0200
From:   "Arnd Bergmann" <arnd@...db.de>
To:     "Dominik Brodowski" <linux@...inikbrodowski.net>,
        "Souptick Joarder" <jrdr.linux@...il.com>
Cc:     "Tony Lindgren" <tony@...mide.com>, linux-kernel@...r.kernel.org,
        "kernel test robot" <lkp@...el.com>
Subject: Re: [PATCH] pcmcia: Removed unused variable control.

On Thu, Sep 22, 2022, at 4:39 PM, Dominik Brodowski wrote:
> Am Mon, Jul 25, 2022 at 06:59:55AM +0530 schrieb Souptick Joarder:
>> From: "Souptick Joarder (HPE)" <jrdr.linux@...il.com>
>> 
>> Kernel test robot throws below warning ->
>> drivers/pcmcia/omap_cf.c:127:7: warning: variable 'control'
>> set but not used [-Wunused-but-set-variable]
>> 
>> Removed unused variable control.
>
> From a code-generation standpoint, this is obiously correct, and probably
> the compiler removes that omap_readw() already.

omap_readw() is an 'extern' function, so it does not get removed.

Even if it was inline, it's still "and volatile" read that gets
left in because it may (and probably does) have side-effects.

> But, to be honest, I'm not
> perfectly sure on what the device expects -- and whether it's required to
> write back the control register (or parts of it). Does anyone still have the
> hardware (or specs)? If not, I'm tempted to apply this patch on the basis
> that the compiler might remove that omap_readw() anyway.

I think assigning to an unused variable was at some point needed to
avoid a compiler warning because otherwise omap_readw() was just a
pointer dereference. The safe way to transform the code should be to
drop the variable but leave the function call.

Note that the driver is only used on the 'osk' reference board,
not on any devices that were in mass-production.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ