lkml.org 
[lkml]   [2023]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] fs: move and constify sysctl_nr_open_min, sysctl_nr_open_max
Date
From: Alexey Dobriyan
> Sent: 14 October 2023 10:23
>
> On Thu, Oct 12, 2023 at 01:54:06PM +0000, David Laight wrote:
> > From: Alexey Dobriyan
> > > Sent: 11 October 2023 19:24
>
> > > +/* our min() is unusable in constant expressions ;-/ */
> > > +#define __const_min(x, y) ((x) < (y) ? (x) : (y))
> > > +static const unsigned int sysctl_nr_open_max =
> > > + __const_min(INT_MAX, ~(size_t)0/sizeof(void *)) & -BITS_PER_LONG;
> >
> > I think you'll find that min() is fine.
>
> Mainline min() still can't do
>
> static const x = min(1, 2);

There has been a whole load of stuff that is supposed to do that
for ages - my changes don't affect it.

I presume they work - because they make it horribly complicated.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2023-10-15 11:19    [W:0.457 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site