[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <261b7728-a9f3-4ceb-8325-b8ad1fae993c@p183>
Date: Sat, 14 Oct 2023 12:22:56 +0300
From: Alexey Dobriyan <adobriyan@...il.com>
To: David Laight <David.Laight@...lab.com>
Cc: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH] fs: move and constify sysctl_nr_open_min,
sysctl_nr_open_max
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);
Powered by blists - more mailing lists