From patchwork Tue Sep 18 12:07:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1472321 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id F00723FCFC for ; Tue, 18 Sep 2012 12:08:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932852Ab2IRMIS (ORCPT ); Tue, 18 Sep 2012 08:08:18 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:63603 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932801Ab2IRMIQ (ORCPT ); Tue, 18 Sep 2012 08:08:16 -0400 Received: by wibhi8 with SMTP id hi8so4064474wib.1 for ; Tue, 18 Sep 2012 05:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=ERocIMVRIeX+cUURkxdp4kUrQFVT/Ivdh1EmqKPF0yo=; b=dPn4RIzIV5+b8Xbih4FLpgOxnUf3pbb+jKhU/kpTg1nYyqQnlZYMflzthIAYnm0hqG VABSAPFa2nEVDxRMjh/nRXyvKEB/xwiSxn3s+VNkBLFlGSTvLYbav4GtxVrOBSX+iho1 tDy3DXFJsK5eeiCbtsS03oZHDWuUh7TuST5sB1XcjvROiWs1eMcUWpJbMoLh8CsWMhjB lBpgpB7pDHKcrDgu++iXT4N/YRQo/T83iE0sjj+YC2zhemWlJfFiQjiFzBgPMNJKDwV1 e6CBj25ATGGs2rwHD5uB7XwFz7PjwLGwuGxbnTx4ktZs0eleJlUIExcEXnsxFES5vx5d 1/TQ== Received: by 10.180.100.131 with SMTP id ey3mr22911862wib.15.1347970095048; Tue, 18 Sep 2012 05:08:15 -0700 (PDT) Received: from ace.home.fr (ppeter.rsr.lip6.fr. [132.227.76.16]) by mx.google.com with ESMTPS id eu4sm22494251wib.2.2012.09.18.05.08.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 05:08:14 -0700 (PDT) From: Peter Senna Tschudin To: linux@arm.linux.org.uk Cc: FlorianSchandinat@gmx.de, linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 08/10] drivers/video/cyber2000fb.c: fix error return code Date: Tue, 18 Sep 2012 14:07:58 +0200 Message-Id: <1347970080-25175-8-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347970080-25175-1-git-send-email-peter.senna@gmail.com> References: <1347970080-25175-1-git-send-email-peter.senna@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From: Peter Senna Tschudin Convert a nonnegative error return code to a negative one, as returned elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // Signed-off-by: Peter Senna Tschudin --- drivers/video/cyber2000fb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/cyber2000fb.c b/drivers/video/cyber2000fb.c index c1527f5..e40125c 100644 --- a/drivers/video/cyber2000fb.c +++ b/drivers/video/cyber2000fb.c @@ -1804,8 +1804,10 @@ cyberpro_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) cfb->irq = dev->irq; cfb->region = pci_ioremap_bar(dev, 0); - if (!cfb->region) + if (!cfb->region) { + err = -ENOMEM; goto failed_ioremap; + } cfb->regs = cfb->region + MMIO_OFFSET; cfb->fb.device = &dev->dev;