From patchwork Tue Sep 18 12:07:51 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: 1472491 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 A43AB3FCFC for ; Tue, 18 Sep 2012 12:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932425Ab2IRMIN (ORCPT ); Tue, 18 Sep 2012 08:08:13 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:60032 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757190Ab2IRMIL (ORCPT ); Tue, 18 Sep 2012 08:08:11 -0400 Received: by wgbdr13 with SMTP id dr13so6782424wgb.1 for ; Tue, 18 Sep 2012 05:08:10 -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; bh=GOwCF8m+oKvapj/pLvXACC11T/9d70PkYfsOcLRVVJk=; b=YeP0QS0o2Ht5KoWzuFuP8MUIEgpFN+83sIIDV8peV2bbNstE1sKNfjq33KH456gdAZ IfcJ614pVg0oD7eGfXLlhRZS6/P2DiymkTnk5R2i7bOs+bwEoadty8pzE1lGhBK0apsO 19g/aLcOl7Bw4/TyF5v8aHx8aqQ28+MrUYs7i7DL9fhuNDBhv2vyNvBXbQo727IbrXZX tbY1QGhxsQ1qFWneAgptBuSt8XLPKiLAH7aGEvNVUCQSsPhkP6hkPQRBvefT0oWuFDuE iy4e52uE/tvl/s3a93cL7l8+IpjB/7ki60qVrdT0mbldGmo/vh3TvAT2uT1n8JoSByrK 4fNg== Received: by 10.216.139.17 with SMTP id b17mr8331544wej.8.1347970089872; Tue, 18 Sep 2012 05:08:09 -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.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 05:08:09 -0700 (PDT) From: Peter Senna Tschudin To: FlorianSchandinat@gmx.de Cc: paul.gortmaker@windriver.com, hsweeten@visionengravers.com, agust@denx.de, davidb@codeaurora.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 01/10] drivers/video/mb862xx/mb862xxfbdrv.c: fix error return code Date: Tue, 18 Sep 2012 14:07:51 +0200 Message-Id: <1347970080-25175-1-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 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/mb862xx/mb862xxfbdrv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/video/mb862xx/mb862xxfbdrv.c b/drivers/video/mb862xx/mb862xxfbdrv.c index 57d940b..d68e332 100644 --- a/drivers/video/mb862xx/mb862xxfbdrv.c +++ b/drivers/video/mb862xx/mb862xxfbdrv.c @@ -1052,12 +1052,14 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev, break; default: /* should never occur */ + ret = -EIO; goto rel_reg; } par->fb_base = ioremap(par->fb_base_phys, par->mapped_vram); if (par->fb_base == NULL) { dev_err(dev, "Cannot map framebuffer\n"); + ret = -EIO; goto rel_reg; } @@ -1073,11 +1075,13 @@ static int __devinit mb862xx_pci_probe(struct pci_dev *pdev, dev_dbg(dev, "mmio phys 0x%llx 0x%lx\n", (unsigned long long)par->mmio_base_phys, (ulong)par->mmio_len); - if (mb862xx_pci_gdc_init(par)) + ret = mb862xx_pci_gdc_init(par); + if (ret) goto io_unmap; - if (request_irq(par->irq, mb862xx_intr, IRQF_SHARED, - DRV_NAME, (void *)par)) { + ret = request_irq(par->irq, mb862xx_intr, IRQF_SHARED, + DRV_NAME, (void *)par); + if (ret) { dev_err(dev, "Cannot request irq\n"); goto io_unmap; }