Thread (20 messages) flat view 20 messages, 5 authors, 2024-01-29

Re: [PATCH next 10/11] block: Use a boolean expression instead of max() on booleans

From: Dan Carpenter <hidden>
Date: 2024-01-29 10:16:41
Also in: dri-devel, linux-btrfs, lkml

On Mon, Jan 29, 2024 at 09:22:40AM +0000, David Laight wrote:
From: Jani Nikula
quoted
Sent: 29 January 2024 09:08

On Sun, 28 Jan 2024, David Laight [off-list ref] wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help