Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Geert Uytterhoeven and committed by
Marc Zyngier
357a9c4b 89583896

+2 -2
+2 -2
drivers/irqchip/irq-mips-gic.c
··· 9 9 10 10 #define pr_fmt(fmt) "irq-mips-gic: " fmt 11 11 12 + #include <linux/bitfield.h> 12 13 #include <linux/bitmap.h> 13 14 #include <linux/clocksource.h> 14 15 #include <linux/cpuhotplug.h> ··· 736 735 mips_gic_base = ioremap(gic_base, gic_len); 737 736 738 737 gicconfig = read_gic_config(); 739 - gic_shared_intrs = gicconfig & GIC_CONFIG_NUMINTERRUPTS; 740 - gic_shared_intrs >>= __ffs(GIC_CONFIG_NUMINTERRUPTS); 738 + gic_shared_intrs = FIELD_GET(GIC_CONFIG_NUMINTERRUPTS, gicconfig); 741 739 gic_shared_intrs = (gic_shared_intrs + 1) * 8; 742 740 743 741 if (cpu_has_veic) {