aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-02-20 13:58:27 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-20 14:54:05 -0800
commit809487c70388961bb44e8f86ee5b54cd9cb3bfb3 (patch)
tree467fa5f5161ac3f23543b798113d8233eac13d26 /include/linux
parentstaging: rdma: hfi1: Replace kmalloc and memcpy with kmemdup (diff)
staging: rdma: hfi1: Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)) but is perhaps more readable. The Coccinelle script used is as follows: // <smpl> @@ expression n,d; @@ ( - (n + d - 1) / d + DIV_ROUND_UP(n,d) | - (n + (d - 1)) / d + DIV_ROUND_UP(n,d) ) @@ expression n,d; @@ - DIV_ROUND_UP((n),d) + DIV_ROUND_UP(n,d) @@ expression n,d; @@ - DIV_ROUND_UP(n,(d)) + DIV_ROUND_UP(n,d) // </smpl> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions