OSDN Git Service

staging: comedi: drivers: Use DIV_ROUND_CLOSEST
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>
Fri, 19 Feb 2016 15:27:15 +0000 (20:57 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Feb 2016 23:25:58 +0000 (15:25 -0800)
commit2ead7b32aadc83833d7cf6e9751ef56b89e90462
treedf9720f1dc9dfe3609b5644afed33b1358b8fa4d
parentb7c57dd54a4531eccb94688907f9b14bcad12c18
staging: comedi: drivers: Use DIV_ROUND_CLOSEST

The kernel.h macro DIV_ROUND_CLOSEST performs the computation
`(x +d/2)/d` but is perhaps more readable.

The Coccinelle script used is as follows:
// <smpl>
@@
expression x,__divisor;
@@
- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/addi_apci_3xxx.c
drivers/staging/comedi/drivers/amplc_pci230.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/dt282x.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/ni_pcidio.c