kchecker: add an --endian option
[smatch.git] / validation / sm_locking.c
blobdabb198028418167900bf026c48417e83e191732
1 _spin_lock(int name);
2 _spin_unlock(int name);
4 int a;
5 int b;
6 int func (void)
8 int mylock = 1;
9 int mylock2 = 1;
10 int mylock3 = 1;
12 if (a) {
13 return;
16 _spin_lock(mylock);
17 _spin_unlock(mylock);
19 if (b) {
20 _spin_unlock(mylock2);
21 return;
24 if (a)
25 _spin_lock(mylock3);
26 return;
29 * check-name: Smatch locking #1
30 * check-command: smatch --project=kernel --spammy sm_locking.c
32 * check-output-start
33 sm_locking.c:26 func() warn: 'spin_lock:mylock3' is sometimes locked here and sometimes unlocked.
34 sm_locking.c:26 func() warn: inconsistent returns 'spin_lock:mylock2'.
35 Locked on: line 13
36 line 26
37 Unlocked on: line 21
38 * check-output-end