aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2008-04-28 05:14:51 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:35 -0400
commit416e74ea7813597b586eafc24f67779eeb86e12f (patch)
treeddb2312349310de0e7a045c6d81bf79d72ed2d0c /drivers/video/console
parent7f29b87a7779505288a31df16ba84a85fc1ae93c (diff)
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>
Diffstat (limited to 'drivers/video/console')
-rw-r--r--drivers/video/console/fbcon.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 022282494d3f..025d4f5e1f6f 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -620,8 +620,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
620 if (fb_get_color_depth(&info->var, &info->fix) == 1) 620 if (fb_get_color_depth(&info->var, &info->fix) == 1)
621 erase &= ~0x400; 621 erase &= ~0x400;
622 logo_height = fb_prepare_logo(info, ops->rotate); 622 logo_height = fb_prepare_logo(info, ops->rotate);
623 logo_lines = (logo_height + vc->vc_font.height - 1) / 623 logo_lines = DIV_ROUND_UP(logo_height, vc->vc_font.height);
624 vc->vc_font.height;
625 q = (unsigned short *) (vc->vc_origin + 624 q = (unsigned short *) (vc->vc_origin +
626 vc->vc_size_row * rows); 625 vc->vc_size_row * rows);
627 step = logo_lines * cols; 626 step = logo_lines * cols;