From be6b0c21654e1c587cb942d464281bcc89ef4ddf Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Mar 2018 20:36:09 +0100 Subject: coccinelle: make use of DIV_ROUND_UP() wherever appropriate Let's use our macros where we can --- coccinelle/div-round-up.cocci | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 coccinelle/div-round-up.cocci (limited to 'coccinelle') diff --git a/coccinelle/div-round-up.cocci b/coccinelle/div-round-up.cocci new file mode 100644 index 0000000000..a0c6df9801 --- /dev/null +++ b/coccinelle/div-round-up.cocci @@ -0,0 +1,20 @@ +@@ +expression x, y; +@@ +- ((x + y - 1) / y) ++ DIV_ROUND_UP(x, y) +@@ +expression x, y; +@@ +- ((x + (y - 1)) / y) ++ DIV_ROUND_UP(x, y) +@@ +expression x, y; +@@ +- (x + y - 1) / y ++ DIV_ROUND_UP(x, y) +@@ +expression x, y; +@@ +- (x + (y - 1)) / y ++ DIV_ROUND_UP(x, y) -- cgit v1.2.1