]> git.baikalelectronics.ru Git - kernel.git/commit
staging: comedi: use DIV_ROUND_UP
authorTapasweni Pathak <tapaswenipathak@gmail.com>
Wed, 8 Oct 2014 17:25:45 +0000 (22:55 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Oct 2014 02:29:19 +0000 (10:29 +0800)
commit6b54ef82925adda5c2a9a2e872d4be418a6e7192
treef0d0a81e38244e0ee5d8ddb699a312b7f890071b
parentfb0f153db154e120651617cec30936ff01254d1b
staging: comedi: use DIV_ROUND_UP

The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.

Coccinelle script used :

// <smpl>
@haskernel@
@@
@depends on haskernel@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
@depends on haskernel@
expression n,d;
@@
- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)
@depends on haskernel@
expression n,d;
@@
- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers.c