summaryrefslogtreecommitdiff
path: root/coccinelle
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-11-26 19:10:26 +0100
committerLennart Poettering <lennart@poettering.net>2018-11-26 22:17:34 +0100
commit020b39497a2a9f6699e984aa473753486d76e01d (patch)
treef2f8d72bf06f348f2c1269e78bf8a2708b017108 /coccinelle
parentf5050e48aee0de888cdea68580e577325ed0d1f8 (diff)
downloadsystemd-020b39497a2a9f6699e984aa473753486d76e01d.tar.gz
tree-wide: use SWAP_TWO a bit more
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/swap-two.cocci7
1 files changed, 7 insertions, 0 deletions
diff --git a/coccinelle/swap-two.cocci b/coccinelle/swap-two.cocci
new file mode 100644
index 0000000000..edf7d32403
--- /dev/null
+++ b/coccinelle/swap-two.cocci
@@ -0,0 +1,7 @@
+@@
+expression x, y, z;
+@@
+- z = x;
+- x = y;
+- y = z;
++ SWAP_TWO(x, y);