aboutsummaryrefslogtreecommitdiff
path: root/scripts/coccinelle/swap_muldiv64.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/coccinelle/swap_muldiv64.cocci')
-rw-r--r--scripts/coccinelle/swap_muldiv64.cocci13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/coccinelle/swap_muldiv64.cocci b/scripts/coccinelle/swap_muldiv64.cocci
new file mode 100644
index 0000000000..b48b0d084a
--- /dev/null
+++ b/scripts/coccinelle/swap_muldiv64.cocci
@@ -0,0 +1,13 @@
+// replace muldiv64(i32, i64, x) by muldiv64(i64, i32, x)
+@@
+typedef uint64_t;
+typedef int64_t;
+typedef uint32_t;
+typedef int32_t;
+{ uint32_t, int32_t, int, unsigned int } a;
+{ uint64_t, int64_t, long, unsigned long } b;
+expression c;
+@@
+
+-muldiv64(a,b,c)
++muldiv64(b,a,c)