From patchwork Sat May 21 19:42:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 806142 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4LJh3v3017363 for ; Sat, 21 May 2011 19:43:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757242Ab1EUTnE (ORCPT ); Sat, 21 May 2011 15:43:04 -0400 Received: from georges.telenet-ops.be ([195.130.137.68]:44468 "EHLO georges.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757276Ab1EUTnB (ORCPT ); Sat, 21 May 2011 15:43:01 -0400 Received: from ayla.of.borg ([84.193.80.148]) by georges.telenet-ops.be with bizsmtp id mKiz1g0053C005g06KizyH; Sat, 21 May 2011 21:43:00 +0200 Received: from geert by ayla.of.borg with local (Exim 4.71) (envelope-from ) id 1QNs4h-0008Ma-E9; Sat, 21 May 2011 21:42:59 +0200 From: Geert Uytterhoeven To: Paul Mundt Cc: linux-fbdev@vger.kernel.org, linux-m68k@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 3/3] fbdev/amifb: Remove superfluous alignment of frame buffer memory Date: Sat, 21 May 2011 21:42:56 +0200 Message-Id: <1306006976-32117-3-git-send-email-geert@linux-m68k.org> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1306006976-32117-1-git-send-email-geert@linux-m68k.org> References: <1306006976-32117-1-git-send-email-geert@linux-m68k.org> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 21 May 2011 19:43:04 +0000 (UTC) amiga_chip_alloc() already aligns to the PAGE_SIZE Signed-off-by: Geert Uytterhoeven --- drivers/video/amifb.c | 15 +++++++-------- 1 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/video/amifb.c b/drivers/video/amifb.c index 1b0185c..5ea6596 100644 --- a/drivers/video/amifb.c +++ b/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); }