Skip to content

Commit d2febf6

Browse files
author
Marc Zyngier
committed
irqchip/qcom-pdc: Drop open coded version of __assign_bit()
The driver uses what looks like an open-coded version of __assign_bit(). Replace it with the real thing. Signed-off-by: Marc Zyngier <maz@kernel.org> Reviewed-by: Maulik Shah <quic_mkshah@quicinc.com> Link: https://lore.kernel.org/r/20220224101226.88373-6-maz@kernel.org
1 parent a6aca2f commit d2febf6

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/irqchip/qcom-pdc.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
#define PDC_MAX_GPIO_IRQS 256
2525

26-
#define CLEAR_INTR(reg, intr) (reg & ~(1 << intr))
27-
#define ENABLE_INTR(reg, intr) (reg | (1 << intr))
28-
2926
#define IRQ_ENABLE_BANK 0x10
3027
#define IRQ_i_CFG 0x110
3128

@@ -55,16 +52,16 @@ static u32 pdc_reg_read(int reg, u32 i)
5552
static void pdc_enable_intr(struct irq_data *d, bool on)
5653
{
5754
int pin_out = d->hwirq;
55+
unsigned long enable;
5856
unsigned long flags;
5957
u32 index, mask;
60-
u32 enable;
6158

6259
index = pin_out / 32;
6360
mask = pin_out % 32;
6461

6562
raw_spin_lock_irqsave(&pdc_lock, flags);
6663
enable = pdc_reg_read(IRQ_ENABLE_BANK, index);
67-
enable = on ? ENABLE_INTR(enable, mask) : CLEAR_INTR(enable, mask);
64+
__assign_bit(mask, &enable, on);
6865
pdc_reg_write(IRQ_ENABLE_BANK, index, enable);
6966
raw_spin_unlock_irqrestore(&pdc_lock, flags);
7067
}

0 commit comments

Comments
 (0)