From patchwork Thu Dec 23 17:17:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 429671 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBNJ5f6Y026223 for ; Thu, 23 Dec 2010 19:07:43 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753396Ab0LWRMk (ORCPT ); Thu, 23 Dec 2010 12:12:40 -0500 Received: from va3ehsobe005.messaging.microsoft.com ([216.32.180.31]:50479 "EHLO VA3EHSOBE005.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753141Ab0LWRMe (ORCPT ); Thu, 23 Dec 2010 12:12:34 -0500 Received: from mail64-va3-R.bigfish.com (10.7.14.249) by VA3EHSOBE005.bigfish.com (10.7.40.25) with Microsoft SMTP Server id 14.1.225.8; Thu, 23 Dec 2010 17:12:32 +0000 Received: from mail64-va3 (localhost.localdomain [127.0.0.1]) by mail64-va3-R.bigfish.com (Postfix) with ESMTP id 5B91998027E; Thu, 23 Dec 2010 17:12:32 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:az33egw02.freescale.net; RD:az33egw02.freescale.net; EFVD:NLI Received: from mail64-va3 (localhost.localdomain [127.0.0.1]) by mail64-va3 (MessageSwitch) id 1293124351998830_26571; Thu, 23 Dec 2010 17:12:31 +0000 (UTC) Received: from VA3EHSMHS017.bigfish.com (unknown [10.7.14.244]) by mail64-va3.bigfish.com (Postfix) with ESMTP id F12B9D60054; Thu, 23 Dec 2010 17:12:31 +0000 (UTC) Received: from az33egw02.freescale.net (192.88.158.103) by VA3EHSMHS017.bigfish.com (10.7.99.27) with Microsoft SMTP Server (TLS) id 14.1.225.8; Thu, 23 Dec 2010 17:12:31 +0000 Received: from de01smr02.am.mot.com (de01smr02.freescale.net [10.208.0.151]) by az33egw02.freescale.net (8.14.3/8.14.3) with ESMTP id oBNHCUnZ027258; Thu, 23 Dec 2010 10:12:30 -0700 (MST) Received: from localhost.localdomain ([10.29.240.182]) by de01smr02.am.mot.com (8.13.1/8.13.0) with ESMTP id oBNHVFJK022979; Thu, 23 Dec 2010 11:31:15 -0600 (CST) From: Fabio Estevam To: CC: , , Fabio Estevam Subject: [PATCH] video: imxfb: Fix the maximum value for yres Date: Thu, 23 Dec 2010 15:17:51 -0200 Message-ID: <1293124671-29426-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.6.0.4 MIME-Version: 1.0 X-OriginatorOrg: freescale.com 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.3 (demeter1.kernel.org [140.211.167.41]); Thu, 23 Dec 2010 19:07:43 +0000 (UTC) diff --git a/drivers/video/imxfb.c b/drivers/video/imxfb.c index 5c363d0..5d2d337 100644 --- a/drivers/video/imxfb.c +++ b/drivers/video/imxfb.c @@ -55,8 +55,10 @@ #ifdef CONFIG_ARCH_MX1 #define SIZE_YMAX(y) ((y) & 0x1ff) +#define YMAX_MASK 0x1ff #else #define SIZE_YMAX(y) ((y) & 0x3ff) +#define YMAX_MASK 0x3ff #endif #define LCDC_VPW 0x08 @@ -623,7 +625,7 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf if (var->right_margin > 255) printk(KERN_ERR "%s: invalid right_margin %d\n", info->fix.id, var->right_margin); - if (var->yres < 1 || var->yres > 511) + if (var->yres < 1 || var->yres > YMAX_MASK) printk(KERN_ERR "%s: invalid yres %d\n", info->fix.id, var->yres); if (var->vsync_len > 100)