repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Makefile: use quiet link to link smatch
[smatch.git]
/
validation
/
sm_locking4.c
blob
301fac7086b920df5a4a35466ea54b6b73316065
1
void
_spin_lock
(
int
name
);
2
void
_spin_unlock
(
int
name
);
3
4
void
frob
(
void
){}
5
int
a
;
6
int
b
;
7
void
func
(
void
)
8
{
9
int
mylock
=
1
;
10
int
mylock2
=
2
;
11
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
}
26
/*
27
* check-name: Smatch locking #4
28
* check-command: smatch --project=kernel sm_locking4.c
29
*
30
* check-output-start
31
sm_locking4.c:23 func() warn: inconsistent returns 'spin_lock:mylock'.
32
Locked on: line 22
33
line 23
34
Unlocked on: line 16
35
* check-output-end
36
*/