Skip to content

Commit 357a9c4

Browse files
geertuMarc Zyngier
authored andcommitted
irqchip/mips-gic: Use bitfield helpers
Use the FIELD_GET() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/all/74f9d126961a90d3e311b92a54870eaac5b3ae57.1637593297.git.geert+renesas@glider.be
1 parent 8958389 commit 357a9c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/irqchip/irq-mips-gic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#define pr_fmt(fmt) "irq-mips-gic: " fmt
1111

12+
#include <linux/bitfield.h>
1213
#include <linux/bitmap.h>
1314
#include <linux/clocksource.h>
1415
#include <linux/cpuhotplug.h>
@@ -735,8 +736,7 @@ static int __init gic_of_init(struct device_node *node,
735736
mips_gic_base = ioremap(gic_base, gic_len);
736737

737738
gicconfig = read_gic_config();
738-
gic_shared_intrs = gicconfig & GIC_CONFIG_NUMINTERRUPTS;
739-
gic_shared_intrs >>= __ffs(GIC_CONFIG_NUMINTERRUPTS);
739+
gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig);
740740
gic_shared_intrs = (gic_shared_intrs + 1) * 8;
741741

742742
if (cpu_has_veic) {

0 commit comments

Comments
 (0)