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]
Date:   Thu, 20 Jun 2019 01:36:43 -0600
From:   Jens Axboe <axboe@...nel.dk>
To:     Arnd Bergmann <arnd@...db.de>, Jiri Kosina <jikos@...nel.org>
Cc:     Robert Elliott <elliott@....com>, Keith Busch <kbusch@...nel.org>,
        Hannes Reinecke <hare@...e.de>, Omar Sandoval <osandov@...com>,
        Sakari Ailus <sakari.ailus@...ux.intel.com>,
        Andy Whitcroft <apw@...onical.com>,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] [RESEND] floppy: fix harmless clang build warning

On 6/19/19 7:19 AM, Arnd Bergmann wrote:
> clang warns about unusual code in floppy.c that looks like it
> was intended to be a bit mask operation, checking for a specific
> bit in the UDP->cmos variable (FLOPPY1_TYPE expands to '4' on
> ARM):
> 
> drivers/block/floppy.c:3902:17: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
>          if (!UDP->cmos && FLOPPY1_TYPE)
>                         ^  ~~~~~~~~~~~~
> drivers/block/floppy.c:3902:17: note: use '&' for a bitwise operation
>          if (!UDP->cmos && FLOPPY1_TYPE)
> 
> The check here is redundant anyway, if FLOPPY1_TYPE is zero, then
> assigning it to a zero UDP->cmos field does not change anything,
> so removing the extra check here has no effect other than shutting
> up the warning.
> 
> On x86, this will no longer read a hardware register, as the
> FLOPPY1_TYPE macro is not expanded if UDP->cmos is already
> zero, but the result is the same.

Applied, thanks.

-- 
Jens Axboe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ