Skip to content
This repository was archived by the owner on Feb 16, 2026. It is now read-only.

Commit 723da9a

Browse files
committed
cocci: Inspect BOC state from ObjWaitState()
After returning from ObjWaitState(), replace any access of oc->boc->state with the one that was captured by the wait loop.
1 parent c400c6e commit 723da9a

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Inspect the state returned by ObjWaitState().
3+
*/
4+
5+
@capture_state@
6+
identifier func;
7+
expression oc;
8+
@@
9+
10+
func(...)
11+
{
12+
...
13+
-ObjWaitState(oc,
14+
+state = ObjWaitState(oc,
15+
...);
16+
...
17+
-oc->boc->state
18+
+state
19+
...
20+
}
21+
22+
@declare_state@
23+
identifier capture_state.func;
24+
@@
25+
26+
func(...)
27+
{
28+
+enum boc_state_e state;
29+
...
30+
}
31+
32+
@ignore_state@
33+
statement stmt;
34+
@@
35+
36+
<...stmt...>
37+
-ObjWaitState(
38+
+(void)ObjWaitState(
39+
...);

0 commit comments

Comments
 (0)