Tag: 2ead7b32aadc83833d7cf6e9751ef56b89e90462

staging: comedi: drivers: Use DIV_ROUND_CLOSEST

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 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: // @@ expression x,__divisor; @@ – (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // Signed-off-by: Amitoj Kaur Chawla Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/addi_apci_3xxx.c | 2 +- drivers/staging/comedi/drivers/amplc_pci230.c …

Continue reading