From patchwork Mon Sep 17 08:15:26 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: 1466031 Return-Path: X-Original-To: patchwork-linux-omap@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 4A9E53FCFC for ; Mon, 17 Sep 2012 08:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753348Ab2IQIPm (ORCPT ); Mon, 17 Sep 2012 04:15:42 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:42545 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092Ab2IQIPk (ORCPT ); Mon, 17 Sep 2012 04:15:40 -0400 Received: by weyx8 with SMTP id x8so3707289wey.19 for ; Mon, 17 Sep 2012 01:15:39 -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=uBsyBqaBmXO/o3+JGr8CjqzgAemTSo1eHiHaEaB4p8Y=; b=FVWaf7cF2Oyz29+aKUbsSffFJ8bbUoEOt7r23hEurOLnAJ4NwXbVCfhMnf0Zv3LP2G lCw8jrgmSS7gj6U6jFdz0aKQSU3EocqsqIocbnq4wUrXBuLiqGHFA11+9ioTZoBLK41d F2/gzcmjorUjEHFmV5ElqLUpAAZ4j8f6U2pwmfsdBB5m5j8+Yj22DxtZn1O/d+7XNmrd crphk1QxrQzLI+j7iIPyHahxqOKuzespG2Kzxh5+IeDQItX7HbRXiIFDOwDqMb2yi1uT Emz6WYlQ195Ocwz70V+lKpaBayqjEPhtuA4MJv0cyrMik128QDkrCARzI4XOIiMcYb1C 86dw== Received: by 10.216.240.8 with SMTP id d8mr5965077wer.157.1347869739114; Mon, 17 Sep 2012 01:15:39 -0700 (PDT) Received: from ace.home.fr (ppeter.rsr.lip6.fr. [132.227.76.16]) by mx.google.com with ESMTPS id eu4sm16677669wib.2.2012.09.17.01.15.38 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 01:15:38 -0700 (PDT) From: Peter Senna Tschudin To: jarkko.lavinen@nokia.com Cc: cjb@laptop.org, linux-omap@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 2/4] drivers/mmc/host/omap.c: fix error return code Date: Mon, 17 Sep 2012 10:15:26 +0200 Message-Id: <1347869728-2696-2-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347869728-2696-1-git-send-email-peter.senna@gmail.com> References: <1347869728-2696-1-git-send-email-peter.senna@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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/mmc/host/omap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c index 48ad361..d468f51 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -1369,8 +1369,10 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) host->irq = irq; host->phys_base = host->mem_res->start; host->virt_base = ioremap(res->start, resource_size(res)); - if (!host->virt_base) + if (!host->virt_base) { + ret = -ENOMEM; goto err_ioremap; + } host->iclk = clk_get(&pdev->dev, "ick"); if (IS_ERR(host->iclk)) { @@ -1438,8 +1440,10 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev) host->reg_shift = (cpu_is_omap7xx() ? 1 : 2); host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0); - if (!host->mmc_omap_wq) + if (!host->mmc_omap_wq) { + err = -ENOMEM; goto err_plat_cleanup; + } for (i = 0; i < pdata->nr_slots; i++) { ret = mmc_omap_new_slot(host, i);