Re: [patch 3/7] soc: dove: Convert generic irqchip locking to guard()

Andrew Lunn
2025-03-13T14:48:25Z

On Thu, Mar 13, 2025 at 03:31:21PM +0100, Thomas Gleixner wrote:
> Conversion was done with Coccinelle. No functional change.
>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Cc: Andrew Lunn <andrew@lunn.ch>
> Cc: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
> Cc: Gregory Clement <gregory.clement@bootlin.com>
> ---
> drivers/soc/dove/pmu.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/soc/dove/pmu.c
> +++ b/drivers/soc/dove/pmu.c
> @@ -257,10 +257,9 @@ static void pmu_irq_handler(struct irq_d
> * So, let's structure the code so that the window is as small as
> * possible.
> */
> - irq_gc_lock(gc);
> + guard(raw_spinlock)(&gc->lock);
> done &= readl_relaxed(base + PMC_IRQ_CAUSE);
> writel_relaxed(done, base + PMC_IRQ_CAUSE);
> - irq_gc_unlock(gc);
> }

My personal preference would be a scoped_guard() rather than this
magical guard() construct which looks nothing like C. But whatever.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Andrew