From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756467AbcB0Lo0 (ORCPT ); Sat, 27 Feb 2016 06:44:26 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:32938 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756178AbcB0LoY (ORCPT ); Sat, 27 Feb 2016 06:44:24 -0500 Date: Sat, 27 Feb 2016 12:44:20 +0100 From: Ingo Molnar To: Alexander Kuleshov Cc: Thomas Gleixner , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/bitops.h: use IS_IMMEDIATE instead of dirrect call of __builtin_constant_p Message-ID: <20160227114420.GB16200@gmail.com> References: <1456491629-11384-1-git-send-email-kuleshovmail@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456491629-11384-1-git-send-email-kuleshovmail@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Alexander Kuleshov wrote: > The arch/x86/include/asm/bitops.h provides IS_IMMEDIATE macro which expands to > the call of the __builtin_constant_p(). Let's use this macro in the test_bit() > to be more clear. > > Signed-off-by: Alexander Kuleshov > --- > arch/x86/include/asm/bitops.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h > index cfe3b95..8cfbd2b 100644 > --- a/arch/x86/include/asm/bitops.h > +++ b/arch/x86/include/asm/bitops.h > @@ -333,7 +333,7 @@ static int test_bit(int nr, const volatile unsigned long *addr); > #endif > > #define test_bit(nr, addr) \ > - (__builtin_constant_p((nr)) \ > + (IS_IMMEDIATE((nr)) \ > ? constant_test_bit((nr), (addr)) \ > : variable_test_bit((nr), (addr))) Why? In the kernel there's more than 200 uses of __builtin_constant_p(), while only 6 uses of IS_IMMEDIATE() ... Thanks, Ingo