Skip to content

Commit aa83869

Browse files
committed
drivers: intc_wch_pfic: replace shift operations with BIT macro
Updated intc_wch_pfic driver to use BIT() macro for clarity. Signed-off-by: Benjamin Cabé <[email protected]>
1 parent b15f942 commit aa83869

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/interrupt_controller/intc_wch_pfic.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,24 @@
1212
#include <zephyr/init.h>
1313
#include <zephyr/irq.h>
1414
#include <zephyr/kernel.h>
15+
#include <zephyr/sys/util.h>
1516

16-
#define SEVONPEND (1 << 4)
17-
#define WFITOWFE (1 << 3)
17+
#define SEVONPEND BIT(4)
18+
#define WFITOWFE BIT(3)
1819

1920
void arch_irq_enable(unsigned int irq)
2021
{
21-
PFIC->IENR[irq / 32] = 1 << (irq % 32);
22+
PFIC->IENR[irq / 32] = BIT(irq % 32);
2223
}
2324

2425
void arch_irq_disable(unsigned int irq)
2526
{
26-
PFIC->IRER[irq / 32] = 1 << (irq % 32);
27+
PFIC->IRER[irq / 32] = BIT(irq % 32);
2728
}
2829

2930
int arch_irq_is_enabled(unsigned int irq)
3031
{
31-
return ((PFIC->ISR[irq >> 5] & (1 << (irq & 0x1F))) != 0);
32+
return ((PFIC->ISR[irq >> 5] & BIT(irq & 0x1F)) != 0);
3233
}
3334

3435
static int pfic_init(void)

0 commit comments

Comments
 (0)