forked from haproxy/haproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV: coccinelle: add endp_flags.cocci
This one turns the various forms of "endp->flags <op> value" to their se_fl_<op>(cs) equivalent. That's basically the same as the previous one except that it acts on the stream endpoint itself instead of the conn_stream.
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
@@ | ||
struct cs_endpoint *endp; | ||
expression e; | ||
@@ | ||
( | ||
- (endp->flags & (e)) | ||
+ se_fl_test(endp, e) | ||
| | ||
- (endp->flags & e) | ||
+ se_fl_test(endp, e) | ||
| | ||
- endp->flags & (e) | ||
+ se_fl_test(endp, e) | ||
| | ||
- endp->flags & e | ||
+ se_fl_test(endp, e) | ||
) | ||
|
||
@@ | ||
struct cs_endpoint *endp; | ||
expression e; | ||
@@ | ||
( | ||
- endp->flags |= (e) | ||
+ se_fl_set(endp, e) | ||
| | ||
- endp->flags |= e | ||
+ se_fl_set(endp, e) | ||
) | ||
|
||
@@ | ||
struct cs_endpoint *endp; | ||
expression e; | ||
@@ | ||
( | ||
- endp->flags &= ~(e) | ||
+ se_fl_clr(endp, e) | ||
| | ||
- endp->flags &= (e) | ||
+ se_fl_clr(endp, ~e) | ||
| | ||
- endp->flags &= ~e | ||
+ se_fl_clr(endp, e) | ||
| | ||
- endp->flags &= e | ||
+ se_fl_clr(endp, ~e) | ||
) | ||
|
||
@@ | ||
struct cs_endpoint *endp; | ||
@@ | ||
- endp->flags = 0 | ||
+ se_fl_zero(endp) | ||
|
||
@@ | ||
struct cs_endpoint *endp; | ||
expression e; | ||
@@ | ||
( | ||
- endp->flags = (e) | ||
+ se_fl_setall(endp, e) | ||
| | ||
- endp->flags = e | ||
+ se_fl_setall(endp, e) | ||
) | ||
|
||
@@ | ||
struct cs_endpoint *endp; | ||
@@ | ||
( | ||
- (endp->flags) | ||
+ se_fl_get(endp) | ||
| | ||
- endp->flags | ||
+ se_fl_get(endp) | ||
) |