]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
staging: comedi: Use macro DIV_ROUND_CLOSEST
authorBhaktipriya Shridhar <bhaktipriya96@gmail.com>
Sun, 21 Feb 2016 10:43:01 +0000 (16:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Mar 2016 22:56:55 +0000 (14:56 -0800)
commit1e5a05d57c2a103903e6980c86057870666a9ac8
tree6c1a0e9b4f0dea7e31ade6a35c673c92fa22a3fc
parent5ee5ae02669f3bfc62a28f6cced596a00ca17803
staging: comedi: Use macro DIV_ROUND_CLOSEST

Occurences of the computation (x +d/2)/d can be replaced with
the macro DIV_ROUND_CLOSEST.

This was detected by the following Coccinelle script.

@@
expression e1,e2;
@@
(
- ((e1) + e2/2) / (e2)
+ DIV_ROUND_CLOSEST(e1,e2)
|
- ((e1) + (e2/2)) / (e2)
+ DIV_ROUND_CLOSEST(e1,e2)
)

Since some lines exceeded the 80 character limit,
some changes were made by hand.

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_mio_common.c