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: <6eaa0f91-104f-4efb-9ea3-7c7f21e75842@moroto.mountain>
Date: Mon, 29 Jan 2024 13:16:36 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: David Laight <David.Laight@...lab.com>
Cc: 'Jani Nikula' <jani.nikula@...ux.intel.com>,
	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>,
	'Linus Torvalds' <torvalds@...ux-foundation.org>,
	'Netdev' <netdev@...r.kernel.org>,
	"'dri-devel@...ts.freedesktop.org'" <dri-devel@...ts.freedesktop.org>,
	'Jens Axboe' <axboe@...nel.dk>,
	"'Matthew Wilcox (Oracle)'" <willy@...radead.org>,
	'Christoph Hellwig' <hch@...radead.org>,
	"'linux-btrfs@...r.kernel.org'" <linux-btrfs@...r.kernel.org>,
	'Andrew Morton' <akpm@...ux-foundation.org>,
	'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>,
	"'David S . Miller'" <davem@...emloft.net>
Subject: Re: [PATCH next 10/11] block: Use a boolean expression instead of
 max() on booleans

On Mon, Jan 29, 2024 at 09:22:40AM +0000, David Laight wrote:
> From: Jani Nikula
> > Sent: 29 January 2024 09:08
> > 
> > On Sun, 28 Jan 2024, David Laight <David.Laight@...LAB.COM> wrote:
> > > blk_stack_limits() contains:
> > > 	t->zoned = max(t->zoned, b->zoned);
> > > These are bool, so it is just a bitwise or.
> > 
> > Should be a logical or, really. And || in code.
> 
> Not really, bitwise is fine for bool (especially for 'or')
> and generates better code.

For | vs || the type doesn't make a difference...  It makes a difference
for AND.  "0x1 & 0x10" vs "0x1 && 0x10".

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ