Print this page
12257 resync smatch to 0.6.1-rc1-il-4
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/validation/sm_locking2.c
+++ new/usr/src/tools/smatch/src/validation/sm_locking2.c
1 1 void _spin_lock(int name);
2 2 void _spin_unlock(int name);
3 3 int _spin_trylock(int name);
4 4
5 5 int a;
6 6 int b;
7 7 int func (void)
8 8 {
9 9 int mylock = 1;
10 10 int mylock2 = 1;
11 11 int mylock3 = 1;
12 12
13 13 if (!_spin_trylock(mylock)) {
14 14 return;
15 15 }
16 16
17 17 _spin_unlock(mylock);
18 18 _spin_unlock(mylock2);
19 19
20 20 if (a)
21 21 _spin_unlock(mylock);
22 22 _spin_lock(mylock2);
↓ open down ↓ |
22 lines elided |
↑ open up ↑ |
23 23
24 24 if (!_spin_trylock(mylock3))
25 25 return;
26 26 return;
27 27 }
28 28 /*
29 29 * check-name: Smatch locking #2
30 30 * check-command: smatch --project=kernel sm_locking2.c
31 31 *
32 32 * check-output-start
33 -sm_locking2.c:21 func() error: double unlock 'spin_lock:mylock'
34 -sm_locking2.c:26 func() warn: inconsistent returns 'spin_lock:mylock3'.
35 - Locked on: line 26
36 - Unlocked on: line 14
37 - line 25
33 +sm_locking2.c:21 func() error: double unlocked 'mylock' (orig line 17)
34 +sm_locking2.c:26 func() warn: inconsistent returns 'mylock3'.
35 + Locked on : 26
36 + Unlocked on: 25
38 37 * check-output-end
39 38 */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX