Tag: 1e5a05d57c2a103903e6980c86057870666a9ac8

staging: comedi: Use macro DIV_ROUND_CLOSEST

Author: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> 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 …

Continue reading