db/fixup_kernel.sh: hack handling of _parse_integer()
[smatch.git] / validation / sm_implied4.c
blob1a3435e618a385f744c448122646303af53a3e46
1 void _spin_lock(int name);
2 void _spin_unlock(int name);
4 void frob(void){}
5 int a;
6 int b;
7 int c;
8 int func (void)
10 int mylock = 1;
11 int mylock2 = 2;
13 if (a == 3)
14 _spin_lock(mylock);
15 if (b)
16 frob();
17 if (a == 3)
18 _spin_unlock(mylock);
19 if (a)
20 _spin_lock(mylock);
21 if (c)
22 return 0;
23 if (!!a)
24 _spin_unlock(mylock);
25 return 0;
29 * check-name: Smatch implied #4
30 * check-command: smatch --project=kernel --spammy sm_implied4.c
32 * check-output-start
33 sm_implied4.c:22 func() warn: 'spin_lock:mylock' is sometimes locked here and sometimes unlocked.
34 * check-output-end