Tag: d9798aa6c33b4da68d9f798e71dca138c9501f74

staging: comedi: drivers: Use DIV_ROUND_CLOSEST

Author: Tapasweni Pathak <tapaswenipathak@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: // @haskernel@ @@ @depends on haskernel@ expression x,__divisor; @@ – (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // Signed-off-by: Tapasweni Pathak Signed-off-by: Greg Kroah-Hartman — drivers/staging/comedi/drivers/s626.c | 2 +- 1 …

Continue reading