From patchwork Mon Sep 17 08:15:25 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: 1465991 Return-Path: X-Original-To: patchwork-linux-mmc@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 599053FCFC for ; Mon, 17 Sep 2012 08:16:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751092Ab2IQIPo (ORCPT ); Mon, 17 Sep 2012 04:15:44 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:54610 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750728Ab2IQIPj (ORCPT ); Mon, 17 Sep 2012 04:15:39 -0400 Received: by wibhq12 with SMTP id hq12so4045099wib.1 for ; Mon, 17 Sep 2012 01:15:38 -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=3I3MLWd345jnN4jzpTKS7HSZp0Ttxqe6pW1sbHl/IbQ=; b=qluKFn3qMuSb9z5ZwGG56XkzBQVlA2pQHMCkQqU0uBCZXxkYNx49hOxE9a0k8Jrw+I val3o3gBD5fG7AGbUqr6EZWOIAVBv7+qqmug/1CELXgGyxnRr3A+lETfgO5NaobxxNr2 9z8Z2ER1/YtzIYvjGc2UC41w0EQP+iADbftKiFS79NkeVJ9vWstzRX6UHZ2mg5hAOa7H tYqNW7JA3p1+jqPK8Q5ZWadjMBJwJfwwOdTn1Xg/hLuoYjYstnEli63CS+ZyaKMHIMga jK59UPJ3ylJfcLenQOEbLlMjum1OtAj/sJhTwp6bxBpojiTtJM+YJLfy5r+CbHSUN4Tz q/0Q== Received: by 10.180.85.167 with SMTP id i7mr14403708wiz.8.1347869738086; Mon, 17 Sep 2012 01:15:38 -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.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 01:15:37 -0700 (PDT) From: Peter Senna Tschudin To: cjb@laptop.org Cc: will.newton@imgtec.com, tgih.jun@samsung.com, jh80.chung@samsung.com, kyungmin.park@samsung.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Peter Senna Tschudin Subject: [PATCH 1/4] drivers/mmc/host/dw_mmc.c: fix error return code Date: Mon, 17 Sep 2012 10:15:25 +0200 Message-Id: <1347869728-2696-1-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 Acked-by: Will Newton --- drivers/mmc/host/dw_mmc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 36f98c0..7ad5176 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2039,8 +2039,10 @@ int dw_mci_probe(struct dw_mci *host) tasklet_init(&host->tasklet, dw_mci_tasklet_func, (unsigned long)host); host->card_workqueue = alloc_workqueue("dw-mci-card", WQ_MEM_RECLAIM | WQ_NON_REENTRANT, 1); - if (!host->card_workqueue) + if (!host->card_workqueue) { + err = -ENOMEM; goto err_dmaunmap; + } INIT_WORK(&host->card_work, dw_mci_work_routine_card); ret = request_irq(host->irq, dw_mci_interrupt, host->irq_flags, "dw-mci", host); if (ret)