All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert+renesas@glider.be>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Serge Semin <fancer.lancer@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Marc Zyngier <maz@kernel.org>
Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert+renesas@glider.be>
Subject: [PATCH] irqchip/mips-gic: Use bitfield helpers
Date: Mon, 22 Nov 2021 16:54:07 +0100	[thread overview]
Message-ID: <74f9d126961a90d3e311b92a54870eaac5b3ae57.1637593297.git.geert+renesas@glider.be> (raw)
In-Reply-To: <a1445d3abb45cfc95cb1b03180fd53caf122035b.1637593297.git.geert+renesas@glider.be>

Use the FIELD_GET() 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.
---
 drivers/irqchip/irq-mips-gic.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c
index d02b05a067d950a0..ff89b36267dd4955 100644
--- a/drivers/irqchip/irq-mips-gic.c
+++ b/drivers/irqchip/irq-mips-gic.c
@@ -9,6 +9,7 @@
 
 #define pr_fmt(fmt) "irq-mips-gic: " fmt
 
+#include <linux/bitfield.h>
 #include <linux/bitmap.h>
 #include <linux/clocksource.h>
 #include <linux/cpuhotplug.h>
@@ -735,8 +736,7 @@ static int __init gic_of_init(struct device_node *node,
 	mips_gic_base = ioremap(gic_base, gic_len);
 
 	gicconfig = read_gic_config();
-	gic_shared_intrs = gicconfig & GIC_CONFIG_NUMINTERRUPTS;
-	gic_shared_intrs >>= __ffs(GIC_CONFIG_NUMINTERRUPTS);
+	gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);
 	gic_shared_intrs = (gic_shared_intrs + 1) * 8;
 
 	if (cpu_has_veic) {
-- 
2.25.1


  parent reply	other threads:[~2021-11-22 15:54 UTC|newest]

Thread overview: 24+ 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 ` Geert Uytterhoeven
2021-11-22 15:53 ` [PATCH] MIPS: CPC: " Geert Uytterhoeven
2021-11-29 12:32   ` Thomas Bogendoerfer
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-22 15:54   ` Geert Uytterhoeven
2021-11-26 11:02   ` [Linux-stm32] " Amelie DELAUNAY
2021-11-26 11:02     ` Amelie DELAUNAY
2021-12-13  9:05   ` Vinod Koul
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 ` Geert Uytterhoeven [this message]
2021-11-22 15:54 ` [PATCH] mfd: mc13xxx: Use " 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)
2021-11-22 16:17   ` 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=74f9d126961a90d3e311b92a54870eaac5b3ae57.1637593297.git.geert+renesas@glider.be \
    --to=geert+renesas@glider.be \
    --cc=fancer.lancer@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tsbogend@alpha.franken.de \
    /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.