db: don't print "failed to open" warnings...
[smatch.git] / validation / sm_locking7.c
blobf2177ff3e04190a2ccb50bedc2052e867c872114
1 #include "check_debug.h"
3 unsigned long arch_local_irq_save();
4 void arch_local_irq_restore(unsigned long flags);
5 int spin_trylock();
6 void frob();
8 void func(int *y)
10 int lock;
11 unsigned long flags;
13 if (({
14 int __ret;
15 flags = arch_local_irq_save();
16 __ret = spin_trylock(&lock);
17 if (!__ret)
18 arch_local_irq_restore(flags);
19 __ret;
20 }))
21 return;
22 frob();
26 * check-name: smatch locking #7
27 * check-command: smatch -p=kernel -I.. sm_locking7.c
29 * check-output-start
30 sm_locking7.c:22 func() warn: inconsistent returns 'irqsave:flags'.
31 Locked on: line 21
32 Unlocked on: line 22
33 sm_locking7.c:22 func() warn: inconsistent returns 'spin_lock:&lock'.
34 Locked on: line 21
35 Unlocked on: line 22
36 * check-output-end