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:   Fri, 4 Jun 2021 07:34:05 -0500
From:   Alex Elder <elder@...aro.org>
To:     David Laight <David.Laight@...LAB.COM>,
        'Manikishan Ghantasala' <manikishanghantasala@...il.com>,
        Alex Elder <elder@...e.org>
Cc:     Alex Elder <elder@...nel.org>,
        "greybus-dev@...ts.linaro.org" <greybus-dev@...ts.linaro.org>,
        "linux-staging@...ts.linux.dev" <linux-staging@...ts.linux.dev>,
        Johan Hovold <johan@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [greybus-dev] [PATCH] staging: greybus: fixed the coding style,
 labels should not be indented.

On 6/4/21 3:13 AM, David Laight wrote:
> Yes, and it isn't at all clear what it actually means.
> If the value of a bool memory location isn't 0 or 1
> what does 'bool_a & bool_b' mean.

I think this discussion is done, but I wanted to point out
that the above expression is incorrect.  It might be valid,
but it would be bad code.  A Boolean, when properly used,
should only be compared with true and false (or the result
of another Boolean expression).  Therefore "&" is not the
right operator, "&&" is.  The reason is similar to why you
would never use ~bool_a, you use !bool_a to invert its value.

					-Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ