From patchwork Mon Sep 23 15:00:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 2928721 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D25D8BFF05 for ; Mon, 23 Sep 2013 15:00:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4A1E320334 for ; Mon, 23 Sep 2013 15:00:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9852F20308 for ; Mon, 23 Sep 2013 15:00:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752626Ab3IWPAT (ORCPT ); Mon, 23 Sep 2013 11:00:19 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:40360 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752314Ab3IWPAS (ORCPT ); Mon, 23 Sep 2013 11:00:18 -0400 Received: by mail-wg0-f53.google.com with SMTP id x12so3229541wgg.8 for ; Mon, 23 Sep 2013 08:00:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=xn/IKGm4kpHl/YWP8WSXqKWEwpuYluT3NIwVGXLxmzU=; b=TDO5cEHyO/pRQTxuRh0ZZ9Ge2nXC0UU7pWzT7dcuE3qL5mFBvaN3LwHRcOu3F2/r8e NyFRh5sFEprf8Ar9WgP1Xk13ei5LB2+z3RzyZAViO9nzhBxLZw9mdOqLfiigej2NP+dm /RdrvyCst09swkCwxhJ1MA2tJt+nDjPuK/ib6POimtky9t+vOtkhSgGSsFQs0kj/TX1b RtjxpAzOph2EiPpOC5xqC7OEiJQdJfAbTy4pkiZRMTB7qMkvYptKeADAhLJ4+jL7rhvi kxsawiawrHIPN1wdDawEVj/LZc1R8voeZd3xqQETZxKY/zZZ9jP4IMidTKhXCYIWwERN l3cA== MIME-Version: 1.0 X-Received: by 10.180.187.236 with SMTP id fv12mr5528194wic.20.1379948415092; Mon, 23 Sep 2013 08:00:15 -0700 (PDT) Received: by 10.194.201.3 with HTTP; Mon, 23 Sep 2013 08:00:15 -0700 (PDT) Date: Mon, 23 Sep 2013 23:00:15 +0800 Message-ID: Subject: [PATCH] s3fb: fix error return code in s3_pci_probe() From: Wei Yongjun To: plagnioj@jcrosoft.com, tomi.valkeinen@ti.com Cc: yongjun_wei@trendmicro.com.cn, linux-fbdev@vger.kernel.org Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Wei Yongjun Fix to return -EINVAL when virtual vertical size smaller than real instead of 0, as done elsewhere in this function. Also remove dup code. Signed-off-by: Wei Yongjun --- drivers/video/s3fb.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index 47ca86c..d838ba8 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c @@ -1336,14 +1336,7 @@ static int s3_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) (info->var.bits_per_pixel * info->var.xres_virtual); if (info->var.yres_virtual < info->var.yres) { dev_err(info->device, "virtual vertical size smaller than real\n"); - goto err_find_mode; - } - - /* maximize virtual vertical size for fast scrolling */ - info->var.yres_virtual = info->fix.smem_len * 8 / - (info->var.bits_per_pixel * info->var.xres_virtual); - if (info->var.yres_virtual < info->var.yres) { - dev_err(info->device, "virtual vertical size smaller than real\n"); + rc = -EINVAL; goto err_find_mode; }