All of lore.kernel.org
 help / color / mirror / Atom feed
* [irqchip: irq/irqchip-fixes] irqchip/mips-gic: Use bitfield helpers
@ 2021-11-25 17:03 irqchip-bot for Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: irqchip-bot for Geert Uytterhoeven @ 2021-11-25 17:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: Geert Uytterhoeven, Marc Zyngier, tglx

The following commit has been merged into the irq/irqchip-fixes branch of irqchip:

Commit-ID:     357a9c4b79f4c8bbceb77c64ea09d8da3a6a870d
Gitweb:        https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/357a9c4b79f4c8bbceb77c64ea09d8da3a6a870d
Author:        Geert Uytterhoeven <geert+renesas@glider.be>
AuthorDate:    Mon, 22 Nov 2021 16:54:07 +01:00
Committer:     Marc Zyngier <maz@kernel.org>
CommitterDate: Thu, 25 Nov 2021 16:55:40 

irqchip/mips-gic: Use bitfield helpers

Use the FIELD_GET() helper, instead of open-coding the same operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/all/74f9d126961a90d3e311b92a54870eaac5b3ae57.1637593297.git.geert+renesas@glider.be
---
 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 d02b05a..ff89b36 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) {

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-25 17:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-25 17:03 [irqchip: irq/irqchip-fixes] irqchip/mips-gic: Use bitfield helpers irqchip-bot for Geert Uytterhoeven

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.