Thread (3 messages) 3 messages, 3 authors, 2009-08-02

Re: [PATCH 15/15] drivers/ide/ide-cd.c: Use DIV_ROUND_CLOSEST

From: Borislav Petkov <hidden>
Date: 2009-08-02 13:51:29
Also in: kernel-janitors, lkml

On Sun, Aug 02, 2009 at 10:49:54AM +0200, Julia Lawall wrote:
From: Julia Lawall <redacted>

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

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@haskernel@
@@

#include <linux/kernel.h>

@depends on haskernel@
expression x,__divisor;
@@

- (((x) + ((__divisor) / 2)) / (__divisor))
+ DIV_ROUND_CLOSEST(x,__divisor)
// </smpl>

Signed-off-by: Julia Lawall <redacted>
Acked-by: Borislav Petkov <redacted>

-- 
Regards/Gruss,
    Boris.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help