All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Alexander Kuleshov <kuleshovmail@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>,
	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
Date: Sat, 27 Feb 2016 12:44:20 +0100	[thread overview]
Message-ID: <20160227114420.GB16200@gmail.com> (raw)
In-Reply-To: <1456491629-11384-1-git-send-email-kuleshovmail@gmail.com>


* Alexander Kuleshov <kuleshovmail@gmail.com> 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 <kuleshovmail@gmail.com>
> ---
>  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

      reply	other threads:[~2016-02-27 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26 13:00 [PATCH] x86/bitops.h: use IS_IMMEDIATE instead of dirrect call of __builtin_constant_p Alexander Kuleshov
2016-02-27 11:44 ` Ingo Molnar [this message]

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=20160227114420.GB16200@gmail.com \
    --to=mingo@kernel.org \
    --cc=kuleshovmail@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.