Re: [PATCH next v2 08/11] minmax: Add min_const() and max_const()

2024-02-25 Thread Dave Airlie
On Mon, 26 Feb 2024 at 07:26, David Laight wrote: > > ... > > Yes, yes, that may end up requiring getting rid of some current users of > > > > #define MIN(a,b) ((a)<(b) ? (a):(b)) > > > > but dammit, we don't actually have _that_ many of them, and why should > > we have random drivers doing that

RE: [PATCH next v2 08/11] minmax: Add min_const() and max_const()

2024-02-25 Thread David Laight
... > Yes, yes, that may end up requiring getting rid of some current users of > > #define MIN(a,b) ((a)<(b) ? (a):(b)) > > but dammit, we don't actually have _that_ many of them, and why should > we have random drivers doing that anyway? They look like they could be changed to min(). It is ev

RE: [PATCH next v2 08/11] minmax: Add min_const() and max_const()

2024-02-25 Thread David Laight
From: Linus Torvalds > Sent: 25 February 2024 17:14 > > On Sun, 25 Feb 2024 at 08:53, David Laight wrote: > > > > The expansions of min() and max() contain statement expressions so are > > not valid for static intialisers. > > min_const() and max_const() are expressions so can be used for static

Re: [PATCH next v2 08/11] minmax: Add min_const() and max_const()

2024-02-25 Thread Linus Torvalds
On Sun, 25 Feb 2024 at 08:53, David Laight wrote: > > The expansions of min() and max() contain statement expressions so are > not valid for static intialisers. > min_const() and max_const() are expressions so can be used for static > initialisers. I hate the name. Naming shouldn't be about an i

[PATCH next v2 08/11] minmax: Add min_const() and max_const()

2024-02-25 Thread David Laight
The expansions of min() and max() contain statement expressions so are not valid for static intialisers. min_const() and max_const() are expressions so can be used for static initialisers. The arguments are checked for being constant and for negative signed values being converted to large unsigned