1 int __raw_local_irq_save();
2 int _spin_trylock(int x
);
3 int raw_local_irq_restore(flags
);
5 #define spin_trylock_irqsave(lock, flags) \
7 (flags) = __raw_local_irq_save(); \
8 _spin_trylock(lock) ? 1 : ({ raw_local_irq_restore(flags); 0; }); \
11 void _spin_unlock_irqrestore(int lock
, int flags
);
20 if (!spin_trylock_irqsave(lock
, flags
))
22 _spin_unlock_irqrestore(lock
, flags
);
25 if (spin_trylock_irqsave(lock
, flags
))
30 * check-name: Smatch locking #6
31 * check-command: smatch -p=kernel sm_locking6.c
34 sm_locking6.c:27 func(12) warn: inconsistent returns irqsave:flags: locked (26) unlocked (21,24,27)
35 sm_locking6.c:27 func(12) warn: inconsistent returns spin_lock:lock: locked (26) unlocked (21,24,27)