From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1341C433ED for ; Fri, 21 May 2021 11:59:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C65F2613DA for ; Fri, 21 May 2021 11:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233394AbhEUMAe (ORCPT ); Fri, 21 May 2021 08:00:34 -0400 Received: from mga11.intel.com ([192.55.52.93]:56835 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbhEUMAc (ORCPT ); Fri, 21 May 2021 08:00:32 -0400 IronPort-SDR: IDLUEa0KXgG51GtPP2rYzQIqL5SVjNeb+zopv8+3GYa63nlgY9t2nGCH7vQ4RrbNbWYffl/Kk1 Z6CeQaFwVOJA== X-IronPort-AV: E=McAfee;i="6200,9189,9990"; a="198383135" X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="198383135" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2021 04:59:08 -0700 IronPort-SDR: 964GNzNNcueW7f3X+WLXZ13B02Xofd6Gu9fJaDkF68VNSvJ82YDwp/y/0znW57e2L83MY8k6pL SG5vvUXG/BMw== X-IronPort-AV: E=Sophos;i="5.82,319,1613462400"; d="scan'208";a="462463118" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 May 2021 04:59:06 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lk3nz-00Dha1-CT; Fri, 21 May 2021 14:59:03 +0300 Date: Fri, 21 May 2021 14:59:03 +0300 From: Andy Shevchenko To: Andrew Morton Cc: Rikard Falkeborn , Tetsuo Handa , Yury Norov , linux-kernel@vger.kernel.org, Ard Biesheuvel , Peter Zijlstra Subject: Re: [PATCH] linux/bits.h: Fix compilation error with GENMASK Message-ID: References: <20210511203716.117010-1-rikard.falkeborn@gmail.com> <20210520134112.ee15f156f1b7dbd3d8f16471@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210520134112.ee15f156f1b7dbd3d8f16471@linux-foundation.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 wrote: > > > --- a/include/linux/const.h > > +++ b/include/linux/const.h > > @@ -3,4 +3,12 @@ > > > > #include > > > > +/* > > + * This returns a constant expression while determining if an argument is > > + * a constant expression, most importantly without evaluating the argument. > > + * Glory to Martin Uecker > > + */ > > +#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