public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MIPS: CPC: Use bitfield helpers
Date: Mon, 29 Nov 2021 13:32:18 +0100	[thread overview]
Message-ID: <20211129123218.GB8232@alpha.franken.de> (raw)
In-Reply-To: <35f0f17e3d987afaa9cd09cdcb8131d42a53c3e1.1637593297.git.geert+renesas@glider.be>

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@glider.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@mips.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 ]

  reply	other threads:[~2021-11-29 12:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 15:53 [PATCH] ARM: ptrace: Use bitfield helpers Geert Uytterhoeven
2021-11-22 15:53 ` [PATCH] MIPS: CPC: " Geert Uytterhoeven
2021-11-29 12:32   ` Thomas Bogendoerfer [this message]
2021-11-22 15:53 ` [PATCH] MIPS: CPS: " Geert Uytterhoeven
2021-11-29 12:32   ` Thomas Bogendoerfer
2021-11-22 15:54 ` [PATCH] crypto: sa2ul - " Geert Uytterhoeven
2021-12-03  5:07   ` Herbert Xu
2021-11-22 15:54 ` [PATCH] dmaengine: stm32-mdma: " Geert Uytterhoeven
2021-11-26 11:02   ` [Linux-stm32] " Amelie DELAUNAY
2021-12-13  9:05   ` Vinod Koul
2021-11-22 15:54 ` [PATCH] intel_th: " Geert Uytterhoeven
2021-11-22 15:54 ` [PATCH] Input: palmas-pwrbutton - use " Geert Uytterhoeven
2021-11-22 15:54 ` [PATCH] irqchip/mips-gic: Use " Geert Uytterhoeven
2021-11-22 15:54 ` [PATCH] mfd: mc13xxx: " Geert Uytterhoeven
2021-11-22 15:54 ` [PATCH] regulator: lp873x: " Geert Uytterhoeven
2021-11-22 16:32   ` Mark Brown
2021-11-22 15:54 ` [PATCH] regulator: lp87565: " Geert Uytterhoeven
2021-11-22 16:33   ` Mark Brown
2021-11-22 16:17 ` [PATCH] ARM: ptrace: " Russell King (Oracle)

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=20211129123218.GB8232@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=geert+renesas@glider.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox