public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Rikard Falkeborn <rikard.falkeborn@gmail.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Yury Norov <yury.norov@gmail.com>,
	linux-kernel@vger.kernel.org, Ard Biesheuvel <ardb@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] linux/bits.h: Fix compilation error with GENMASK
Date: Fri, 21 May 2021 14:59:03 +0300	[thread overview]
Message-ID: <YKeghxRY4FeOKuwb@smile.fi.intel.com> (raw)
In-Reply-To: <20210520134112.ee15f156f1b7dbd3d8f16471@linux-foundation.org>

On Thu, May 20, 2021 at 01:41:12PM -0700, Andrew Morton wrote:
> On Tue, 11 May 2021 22:37:15 +0200 Rikard Falkeborn <rikard.falkeborn@gmail.com> wrote:
> 
> > --- a/include/linux/const.h
> > +++ b/include/linux/const.h
> > @@ -3,4 +3,12 @@
> >  
> >  #include <vdso/const.h>
> >  
> > +/*
> > + * This returns a constant expression while determining if an argument is
> > + * a constant expression, most importantly without evaluating the argument.
> > + * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
> > + */
> > +#define __is_constexpr(x) \
> > +	(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
> 
> Boggle.
> 
> Could someone please sometime enhance that comment a bit?  What need
> does this thing satisfy and how on earth does it work?

Some summary based on (links from) https://vegard.wiki/w/is_constexpr() ?

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-05-21 11:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-11 20:37 [PATCH] linux/bits.h: Fix compilation error with GENMASK Rikard Falkeborn
2021-05-12 12:53 ` Ard Biesheuvel
2021-05-20 18:46   ` Rikard Falkeborn
2021-05-20 19:44     ` Yury Norov
2021-05-20 20:15       ` Arnd Bergmann
2021-05-20 20:41 ` Andrew Morton
2021-05-21 11:59   ` Andy Shevchenko [this message]
2021-05-21 10:15 ` Andy Shevchenko

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=YKeghxRY4FeOKuwb@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=ardb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=peterz@infradead.org \
    --cc=rikard.falkeborn@gmail.com \
    --cc=yury.norov@gmail.com \
    /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