]> git.baikalelectronics.ru Git - kernel.git/commit
staging: rdma: hfi1: Use DIV_ROUND_UP
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Sat, 20 Feb 2016 08:28:27 +0000 (13:58 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 22:54:05 +0000 (14:54 -0800)
commite44911410c55d75b7e2b2bdc91ce24cdd5941470
tree467fa5f5161ac3f23543b798113d8233eac13d26
parent500edd69a773de88128ae2511ad8493bf682b9ac
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>
drivers/staging/rdma/hfi1/mr.c