You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
fbdev: use DIV_ROUND_UP or roundup
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of 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 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: Julia Lawall <julia@diku.dk> Cc: "Antonino A. Daplas" <adaplas@pol.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
7f29b87a77
commit
416e74ea78
@@ -1270,7 +1270,7 @@ again:
|
||||
|
||||
gstart = (prescale / 2 + plen * left_margin) / prescale;
|
||||
/* gend1 is for hde (gend-gstart multiple of align), shifter's xres */
|
||||
gend1 = gstart + ((xres + align - 1) / align) * align * plen / prescale;
|
||||
gend1 = gstart + roundup(xres, align) * plen / prescale;
|
||||
/* gend2 is for hbb, visible xres (rest to gend1 is cut off by hblank) */
|
||||
gend2 = gstart + xres * plen / prescale;
|
||||
par->HHT = plen * (left_margin + xres + right_margin) /
|
||||
|
||||
Reference in New Issue
Block a user