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

2024-01-29 Thread Dan Carpenter
On Mon, Jan 29, 2024 at 09:22:40AM +, David Laight wrote: > From: Jani Nikula > > Sent: 29 January 2024 09:08 > > > > On Sun, 28 Jan 2024, David Laight wrote: > > > blk_stack_limits() contains: > > > t->zoned = max(t->zoned, b->zoned); > > > These are bool, so it is just a bitwise or. > >

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

2024-01-29 Thread Jani Nikula
On Mon, 29 Jan 2024, David Laight wrote: > From: Jani Nikula >> Sent: 29 January 2024 09:08 >> >> On Sun, 28 Jan 2024, David Laight 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,

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

2024-01-29 Thread David Laight
From: Jani Nikula > Sent: 29 January 2024 09:08 > > On Sun, 28 Jan 2024, David Laight 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 fi

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

2024-01-29 Thread Jani Nikula
On Sun, 28 Jan 2024, David Laight 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. BR, Jani. > However it generates: > error: comparison of constant ‘0’ with boole

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

2024-01-28 Thread Linus Torvalds
On Sun, 28 Jan 2024 at 14:22, David Laight wrote: > > H blame gcc :-) I do agree that the gcc warning quoting is unnecessarily ugly (even just visually), but.. > The error message displays as '0' but is e2:80:98 30 e2:80:99 > I HATE UTF-8, it wouldn't be as bad if it were a bijection. No, t

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

2024-01-28 Thread David Laight
From: Linus Torvalds > Sent: 28 January 2024 19:59 > > On Sun, 28 Jan 2024 at 11:36, David Laight wrote: > > > > However it generates: > > error: comparison of constant ‘0’ with boolean expression is always > > true [-Werror=bool-compare] > > inside the signedness check that max() does unles

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

2024-01-28 Thread Linus Torvalds
On Sun, 28 Jan 2024 at 11:36, David Laight wrote: > > However it generates: > error: comparison of constant ‘0’ with boolean expression is always true > [-Werror=bool-compare] > inside the signedness check that max() does unless a '+ 0' is added. Please fix your locale. You have random garba

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

2024-01-28 Thread David Laight
blk_stack_limits() contains: t->zoned = max(t->zoned, b->zoned); These are bool, so it is just a bitwise or. However it generates: error: comparison of constant ‘0’ with boolean expression is always true [-Werror=bool-compare] inside the signedness check that max() does unless a '+ 0'