linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Rich Felker <dalias@libc.org>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sh: use __builtin_constant_p() directly instead of IS_IMMEDIATE()
Date: Sat, 27 Jul 2019 13:46:43 +0000	[thread overview]
Message-ID: <87pnlvpp30.wl-ysato@users.sourceforge.jp> (raw)
In-Reply-To: <20190723074943.17093-1-yamada.masahiro@socionext.com>

On Tue, 23 Jul 2019 16:49:43 +0900,
Masahiro Yamada wrote:
> 
> __builtin_constant_p(nr) is used everywhere now. It does not make
> much sense to define IS_IMMEDIATE() as its alias.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  arch/sh/include/asm/bitops-op32.h | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/sh/include/asm/bitops-op32.h b/arch/sh/include/asm/bitops-op32.h
> index 466880362ad1..cfe5465acce7 100644
> --- a/arch/sh/include/asm/bitops-op32.h
> +++ b/arch/sh/include/asm/bitops-op32.h
> @@ -16,11 +16,9 @@
>  #define BYTE_OFFSET(nr)		((nr) % BITS_PER_BYTE)
>  #endif
>  
> -#define IS_IMMEDIATE(nr)	(__builtin_constant_p(nr))
> -
>  static inline void __set_bit(int nr, volatile unsigned long *addr)
>  {
> -	if (IS_IMMEDIATE(nr)) {
> +	if (__builtin_constant_p(nr)) {
>  		__asm__ __volatile__ (
>  			"bset.b %1, @(%O2,%0)		! __set_bit\n\t"
>  			: "+r" (addr)
> @@ -37,7 +35,7 @@ static inline void __set_bit(int nr, volatile unsigned long *addr)
>  
>  static inline void __clear_bit(int nr, volatile unsigned long *addr)
>  {
> -	if (IS_IMMEDIATE(nr)) {
> +	if (__builtin_constant_p(nr)) {
>  		__asm__ __volatile__ (
>  			"bclr.b %1, @(%O2,%0)		! __clear_bit\n\t"
>  			: "+r" (addr)
> @@ -64,7 +62,7 @@ static inline void __clear_bit(int nr, volatile unsigned long *addr)
>   */
>  static inline void __change_bit(int nr, volatile unsigned long *addr)
>  {
> -	if (IS_IMMEDIATE(nr)) {
> +	if (__builtin_constant_p(nr)) {
>  		__asm__ __volatile__ (
>  			"bxor.b %1, @(%O2,%0)		! __change_bit\n\t"
>  			: "+r" (addr)
> -- 
> 2.17.1
> 

Applied sh-next.
Thanks.

-- 
Yosinori Sato

      reply	other threads:[~2019-07-27 13:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-23  7:49 [PATCH] sh: use __builtin_constant_p() directly instead of IS_IMMEDIATE() Masahiro Yamada
2019-07-27 13:46 ` Yoshinori Sato [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=87pnlvpp30.wl-ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=dalias@libc.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=yamada.masahiro@socionext.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;
as well as URLs for NNTP newsgroup(s).