From 2468a14bc2e74e79fe9828b5ee4a09612227ec4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= Date: Fri, 17 Aug 2012 09:26:42 +0200 Subject: [PATCH] use ALIGN() instead of open-coding its functionality --- drivers/video/mxc_ipuv3_fb.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c index c664dbfdd0..074aa924d9 100644 --- a/drivers/video/mxc_ipuv3_fb.c +++ b/drivers/video/mxc_ipuv3_fb.c @@ -435,17 +435,14 @@ static int mxcfb_unmap_video_memory(struct fb_info *fbi) */ static struct fb_info *mxcfb_init_fbinfo(void) { -#define BYTES_PER_LONG 4 -#define PADDING (BYTES_PER_LONG - (sizeof(struct fb_info) % BYTES_PER_LONG)) struct fb_info *fbi; struct mxcfb_info *mxcfbi; - char *p; - int size = sizeof(struct mxcfb_info) + PADDING + + void *p; + int size = ALIGN(sizeof(struct mxcfb_info), sizeof(long)) + sizeof(struct fb_info); - debug("%s: %d %d %d %d\n", + debug("%s: %d %d %d\n", __func__, - PADDING, size, sizeof(struct mxcfb_info), sizeof(struct fb_info)); @@ -460,7 +457,7 @@ static struct fb_info *mxcfb_init_fbinfo(void) memset(p, 0, size); fbi = p; - fbi->par = p + sizeof(struct fb_info) + PADDING; + fbi->par = p + ALIGN(sizeof(struct fb_info), sizeof(long)); mxcfbi = (struct mxcfb_info *)fbi->par; debug("Framebuffer structures at: fbi=%p mxcfbi=%p\n", -- 2.39.2