Re: [PATCH 3/3] alarmtimer: switch spin_{lock,unlock}_irqsave() to guard()

Dan Carpenter
2025-04-25T13:04:53Z

On Thu, Apr 24, 2025 at 10:48:20PM +0800, Su Hui wrote:
> @@ -230,15 +226,15 @@ static int alarmtimer_suspend(struct device *dev)
> ktime_t min, now, expires;
> int i, ret, type;
> struct rtc_device *rtc;
> - unsigned long flags;
> struct rtc_time tm;
>
> - spin_lock_irqsave(&freezer_delta_lock, flags);
> - min = freezer_delta;
> - expires = freezer_expires;
> - type = freezer_alarmtype;
> - freezer_delta = 0;
> - spin_unlock_irqrestore(&freezer_delta_lock, flags);
> + scoped_guard(spinlock_irqsave, &freezer_delta_lock) {
> + min = freezer_delta;
> + expires = freezer_expires;
> + type = freezer_alarmtype;
> + freezer_delta = 0;
> + }
> +
>

Don't add the extra blank line here.

> rtc = alarmtimer_get_rtcdev();
> /* If we have no rtcdev, just return */

regards,
dan carpenter