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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20211129123218.GB8232@alpha.franken.de>
Date:   Mon, 29 Nov 2021 13:32:18 +0100
From:   Thomas Bogendoerfer <tsbogend@...ha.franken.de>
To:     Geert Uytterhoeven <geert+renesas@...der.be>
Cc:     linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] MIPS: CPC: Use bitfield helpers

On Mon, Nov 22, 2021 at 04:53:46PM +0100, Geert Uytterhoeven wrote:
> Use the FIELD_PREP() helper, instead of open-coding the same operation.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
> ---
> Compile-tested only.
> 
> See "[PATCH 00/17] Non-const bitfield helper conversions"
> (https://lore.kernel.org/r/cover.1637592133.git.geert+renesas@glider.be)
> for background and more conversions.
> ---
>  arch/mips/kernel/mips-cpc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/mips/kernel/mips-cpc.c b/arch/mips/kernel/mips-cpc.c
> index 8d2535123f11c8f3..17aff13cd7ce6ea7 100644
> --- a/arch/mips/kernel/mips-cpc.c
> +++ b/arch/mips/kernel/mips-cpc.c
> @@ -4,6 +4,7 @@
>   * Author: Paul Burton <paul.burton@...s.com>
>   */
>  
> +#include <linux/bitfield.h>
>  #include <linux/errno.h>
>  #include <linux/percpu.h>
>  #include <linux/of.h>
> @@ -97,7 +98,7 @@ void mips_cpc_lock_other(unsigned int core)
>  	curr_core = cpu_core(&current_cpu_data);
>  	spin_lock_irqsave(&per_cpu(cpc_core_lock, curr_core),
>  			  per_cpu(cpc_core_lock_flags, curr_core));
> -	write_cpc_cl_other(core << __ffs(CPC_Cx_OTHER_CORENUM));
> +	write_cpc_cl_other(FIELD_PREP(CPC_Cx_OTHER_CORENUM, core));
>  
>  	/*
>  	 * Ensure the core-other region reflects the appropriate core &
> -- 
> 2.25.1

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ