mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexey Dobriyan' <adobriyan@gmail.com>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: RE: [PATCH] fs: move and constify sysctl_nr_open_min, sysctl_nr_open_max
Date: Sun, 15 Oct 2023 09:16:54 +0000	[thread overview]
Message-ID: <42f1dc15162141acb5931bb628c56866@AcuMS.aculab.com> (raw)
In-Reply-To: <261b7728-a9f3-4ceb-8325-b8ad1fae993c@p183>

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)

  reply	other threads:[~2023-10-15  9:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-11 18:24 Alexey Dobriyan
2023-10-12 13:54 ` David Laight
2023-10-14  9:22   ` Alexey Dobriyan
2023-10-15  9:16     ` David Laight [this message]
2023-10-15  9:30     ` David Laight

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42f1dc15162141acb5931bb628c56866@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®