math: improve how get_absolute_min/max() work
[smatch.git] / validation / sm_locking4.c
blob088fdf566a1bc85f7f220b5e74fc7e03fa0bdf6c
1 void _spin_lock(int name);
2 void _spin_unlock(int name);
4 void frob(void){}
5 int a;
6 int b;
7 int func (void)
9 int mylock = 1;
10 int mylock2 = 2;
12 if (1)
13 _spin_unlock(mylock);
14 frob();
15 if (a)
16 return;
17 if (!0)
18 _spin_lock(mylock);
19 if (0)
20 _spin_unlock(mylock);
21 if (b)
22 return;
23 if (!1)
24 _spin_lock(mylock);
25 return 0;
28 * check-name: Smatch locking #4
29 * check-command: smatch --project=kernel sm_locking4.c
31 * check-output-start
32 sm_locking4.c:25 func() warn: inconsistent returns spin_lock:mylock: locked (22,25) unlocked (16)
33 * check-output-end