diff options
author | Laurent Vivier <lvivier@redhat.com> | 2016-05-09 15:24:55 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2016-06-07 18:02:49 +0300 |
commit | e9d5150739c4e321088eddfe46b88a8654d86eae (patch) | |
tree | 9a47ab91710c6f160a534dffdeb00d9c18e872ad /scripts/coccinelle/simplify_muldiv64.cocci | |
parent | 96165b9eb4207a34a87c46df731d3cc42c052e13 (diff) |
scripts: add muldiv64() checking coccinelle scripts
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'scripts/coccinelle/simplify_muldiv64.cocci')
-rw-r--r-- | scripts/coccinelle/simplify_muldiv64.cocci | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/coccinelle/simplify_muldiv64.cocci b/scripts/coccinelle/simplify_muldiv64.cocci new file mode 100644 index 0000000000..3d7c9744aa --- /dev/null +++ b/scripts/coccinelle/simplify_muldiv64.cocci @@ -0,0 +1,11 @@ +// replace muldiv64(i32, i32, x) by (uint64_t)i32 * i32 / x +@@ +typedef uint32_t; +typedef int32_t; +{ uint32_t, int32_t, int, unsigned int } a, b; +typedef uint64_t; +expression c; +@@ + +-muldiv64(a,b,c) ++(uint64_t) a * b / c |