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

Su Hui
2025-04-27T02:16:21Z

On 2025/4/25 21:04, Dan Carpenter wrote:
> 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.

Will update in v2 patch, thanks for the suggestion.

Su Hui