aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-03-20 20:36:09 +0100
committerLennart Poettering <lennart@poettering.net>2018-03-20 20:59:02 +0100
commitbe6b0c21654e1c587cb942d464281bcc89ef4ddf (patch)
tree64ae8adf2baaabbcd146402e098c0760a0e9c7ac /coccinelle
parentbasic/fs-util: skip fsync_directory_of_file() if /proc/self/fd/ is not availa... (diff)
downloadsystemd-be6b0c21654e1c587cb942d464281bcc89ef4ddf.tar.gz
systemd-be6b0c21654e1c587cb942d464281bcc89ef4ddf.tar.bz2
systemd-be6b0c21654e1c587cb942d464281bcc89ef4ddf.zip
coccinelle: make use of DIV_ROUND_UP() wherever appropriate
Let's use our macros where we can
Diffstat (limited to 'coccinelle')
-rw-r--r--coccinelle/div-round-up.cocci20
1 files changed, 20 insertions, 0 deletions
diff --git a/coccinelle/div-round-up.cocci b/coccinelle/div-round-up.cocci
new file mode 100644
index 000000000..a0c6df980
--- /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)