Re: [PATCH 3/5] irqchip/irq-imx-gpcv2: Make use of BIT() macro

From: Lucas Stach
Date: Thu Dec 06 2018 - 06:12:17 EST


Am Mittwoch, den 05.12.2018, 23:31 -0800 schrieb Andrey Smirnov:
> Convert all instances of 1 << x to BIT(x) for consistency with other
> kernel code.
>
> Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Cc: Jason Cooper <jason@xxxxxxxxxxxxxx>
> Cc: Marc Zyngier <marc.zyngier@xxxxxxx>
> Cc: cphealy@xxxxxxxxx
> Cc: l.stach@xxxxxxxxxxxxxx
> Cc: Leonard Crestez <leonard.crestez@xxxxxxx>
> Cc: "A.s. Dong" <aisheng.dong@xxxxxxx>
> Cc: Richard Zhu <hongxing.zhu@xxxxxxx>
> Cc: linux-imx@xxxxxxx
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Signed-off-by: Andrey Smirnov <andrew.smirnov@xxxxxxxxx>

Reviewed-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>

> ---
> Âdrivers/irqchip/irq-imx-gpcv2.c | 6 +++---
> Â1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/irqchip/irq-imx-gpcv2.c b/drivers/irqchip/irq-
> imx-gpcv2.c
> index b262ba8b2652..077d56b3183a 100644
> --- a/drivers/irqchip/irq-imx-gpcv2.c
> +++ b/drivers/irqchip/irq-imx-gpcv2.c
> @@ -78,7 +78,7 @@ static int imx_gpcv2_irq_set_wake(struct irq_data
> *d, unsigned int on)
> Â u32 mask, val;
> Â
> Â raw_spin_lock_irqsave(&cd->rlock, flags);
> - mask = 1 << d->hwirq % 32;
> + mask = BIT(d->hwirq % 32);
> Â val = cd->wakeup_sources[idx];
> Â
> Â cd->wakeup_sources[idx] = on ? (val & ~mask) : (val | mask);
> @@ -101,7 +101,7 @@ static void imx_gpcv2_irq_unmask(struct irq_data
> *d)
> Â raw_spin_lock(&cd->rlock);
> Â reg = gpcv2_idx_to_reg(cd, d->hwirq / 32);
> Â val = readl_relaxed(reg);
> - val &= ~(1 << d->hwirq % 32);
> + val &= ~BIT(d->hwirq % 32);
> Â writel_relaxed(val, reg);
> Â raw_spin_unlock(&cd->rlock);
> Â
> @@ -117,7 +117,7 @@ static void imx_gpcv2_irq_mask(struct irq_data
> *d)
> Â raw_spin_lock(&cd->rlock);
> Â reg = gpcv2_idx_to_reg(cd, d->hwirq / 32);
> Â val = readl_relaxed(reg);
> - val |= 1 << (d->hwirq % 32);
> + val |= BIT(d->hwirq % 32);
> Â writel_relaxed(val, reg);
> Â raw_spin_unlock(&cd->rlock);
> Â