lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Sat, 27 Jul 2019 22:46:43 +0900
From:   Yoshinori Sato <ysato@...rs.sourceforge.jp>
To:     Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc:     Rich Felker <dalias@...c.org>, linux-sh@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sh: use __builtin_constant_p() directly instead of IS_IMMEDIATE()

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@...ionext.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ