diff options
Diffstat (limited to 'dev/coccinelle/endp_flags.cocci')
-rw-r--r-- | dev/coccinelle/endp_flags.cocci | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/dev/coccinelle/endp_flags.cocci b/dev/coccinelle/endp_flags.cocci new file mode 100644 index 0000000..fceda27 --- /dev/null +++ b/dev/coccinelle/endp_flags.cocci @@ -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) +) |