From 397279afb46ee226e578abb57de207163037eeb5 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Sat, 21 May 2011 19:42:56 +0000 Subject: [PATCH] --- yaml --- r: 251113 b: refs/heads/master c: 8f25c01dec43ccfb0ec7d6216c1494772917a429 h: refs/heads/master i: 251111: e58872ac34ddcc14dce29a6c2831f20f59f92e7c v: v3 --- [refs] | 2 +- trunk/drivers/video/amifb.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index bbd669216175..89f1ed1bebe0 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a707642a0653c457376068d9d4a77afe93c10c93 +refs/heads/master: 8f25c01dec43ccfb0ec7d6216c1494772917a429 diff --git a/trunk/drivers/video/amifb.c b/trunk/drivers/video/amifb.c index 1b0185cf6868..5ea6596dd824 100644 --- a/trunk/drivers/video/amifb.c +++ b/trunk/drivers/video/amifb.c @@ -2224,24 +2224,23 @@ static int amifb_ioctl(struct fb_info *info, * Allocate, Clear and Align a Block of Chip Memory */ -static u_long unaligned_chipptr = 0; +static void *aligned_chipptr; static inline u_long __init chipalloc(u_long size) { - size += PAGE_SIZE-1; - if (!(unaligned_chipptr = (u_long)amiga_chip_alloc(size, - "amifb [RAM]"))) { + aligned_chipptr = amiga_chip_alloc(size, "amifb [RAM]"); + if (!aligned_chipptr) { pr_err("amifb: No Chip RAM for frame buffer"); return 0; } - memset((void *)unaligned_chipptr, 0, size); - return PAGE_ALIGN(unaligned_chipptr); + memset(aligned_chipptr, 0, size); + return (u_long)aligned_chipptr; } static inline void chipfree(void) { - if (unaligned_chipptr) - amiga_chip_free((void *)unaligned_chipptr); + if (aligned_chipptr) + amiga_chip_free(aligned_chipptr); }