Skip to content

Commit 04d8a9d

Browse files
Julia Lawallmattst88
authored andcommitted
arch/alpha/kernel/sys_ruffian.c: Use DIV_ROUND_CLOSEST
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@ @@ @Depends on haskernel@ expression x,__divisor; @@ - (((x) + ((__divisor) / 2)) / (__divisor)) + DIV_ROUND_CLOSEST(x,__divisor) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Matt Turner <mattst88@gmail.com>
1 parent a8a8a66 commit 04d8a9d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/alpha/kernel/sys_ruffian.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ ruffian_init_irq(void)
6666
common_init_isa_dma();
6767
}
6868

69-
#define RUFFIAN_LATCH ((PIT_TICK_RATE + HZ / 2) / HZ)
69+
#define RUFFIAN_LATCH DIV_ROUND_CLOSEST(PIT_TICK_RATE, HZ)
7070

7171
static void __init
7272
ruffian_init_rtc(void)

0 commit comments

Comments
 (0)