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

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

+2 -5
+2 -5
drivers/irqchip/qcom-pdc.c
··· 23 23 24 24 #define PDC_MAX_GPIO_IRQS 256 25 25 26 - #define CLEAR_INTR(reg, intr) (reg & ~(1 << intr)) 27 - #define ENABLE_INTR(reg, intr) (reg | (1 << intr)) 28 - 29 26 #define IRQ_ENABLE_BANK 0x10 30 27 #define IRQ_i_CFG 0x110 31 28 ··· 52 55 static void pdc_enable_intr(struct irq_data *d, bool on) 53 56 { 54 57 int pin_out = d->hwirq; 58 + unsigned long enable; 55 59 unsigned long flags; 56 60 u32 index, mask; 57 - u32 enable; 58 61 59 62 index = pin_out / 32; 60 63 mask = pin_out % 32; 61 64 62 65 raw_spin_lock_irqsave(&pdc_lock, flags); 63 66 enable = pdc_reg_read(IRQ_ENABLE_BANK, index); 64 - enable = on ? ENABLE_INTR(enable, mask) : CLEAR_INTR(enable, mask); 67 + __assign_bit(mask, &enable, on); 65 68 pdc_reg_write(IRQ_ENABLE_BANK, index, enable); 66 69 raw_spin_unlock_irqrestore(&pdc_lock, flags); 67 70 }