From patchwork Mon Jun 10 15:03:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 17734 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f198.google.com (mail-ye0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A78502397B for ; Mon, 10 Jun 2013 15:04:13 +0000 (UTC) Received: by mail-ye0-f198.google.com with SMTP id m13sf6366094yen.1 for ; Mon, 10 Jun 2013 08:04:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-beenthere:x-forwarded-to:x-forwarded-for:delivered-to:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :mime-version:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=cqY/gy/VKmUuZxatqb8MWRddVAA6sE3hF0L7aCcFGbI=; b=F9lxlOO+XAc1ZzkgsBXQiFOFN67xGSkZO9dzq2qqR+QDwhCMKh8RO/z3JZwA6KLxjQ JGoxWlwbmUIAlS2l6xJ4og9zHvxMszIiK68PVw57wS9H2ome4elhsbtyJ9TIAc0ktZGI vf8c5q+Ta/T0SALrK7h9zr51W9mez6dUoZvDZbuX/V3GeBM2PZJYJ8bVAB5cwW0uGrM0 gUBSkVHod2Mdzu0ppEzeTwFv5ClfLemt1a+29AXhJfdzTbHNXUeegJKM2CPIVSOB8qyv Om7ZYCq5i+1Wqtjmg3F2RdpDhVy6vOjOjDksEKhA59ns2Xwzh5I/1XlhhcTuy5MjRvCN IYZg== X-Received: by 10.58.96.77 with SMTP id dq13mr1530677veb.2.1370876653199; Mon, 10 Jun 2013 08:04:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.128.104 with SMTP id nn8ls2972742qeb.38.gmail; Mon, 10 Jun 2013 08:04:13 -0700 (PDT) X-Received: by 10.52.114.135 with SMTP id jg7mr4940406vdb.78.1370876652983; Mon, 10 Jun 2013 08:04:12 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id sc6si5045021vdc.125.2013.06.10.08.04.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id lf11so3695907vcb.40 for ; Mon, 10 Jun 2013 08:04:12 -0700 (PDT) X-Received: by 10.58.173.36 with SMTP id bh4mr5916318vec.9.1370876652726; Mon, 10 Jun 2013 08:04:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.221.10.206 with SMTP id pb14csp71470vcb; Mon, 10 Jun 2013 08:04:11 -0700 (PDT) X-Received: by 10.14.211.69 with SMTP id v45mr11826911eeo.45.1370876651129; Mon, 10 Jun 2013 08:04:11 -0700 (PDT) Received: from eu1sys200aog120.obsmtp.com (eu1sys200aog120.obsmtp.com [207.126.144.149]) by mx.google.com with SMTP id g7si8534077eew.165.2013.06.10.08.04.07 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 10 Jun 2013 08:04:11 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.149 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.149; Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob120.postini.com ([207.126.147.11]) with SMTP ID DSNKUbXq5ecoALKzMpPR3oAeIZUugKXRnj2R@postini.com; Mon, 10 Jun 2013 15:04:10 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 3F6F1C2; Mon, 10 Jun 2013 15:04:03 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id ED40BFC9; Mon, 10 Jun 2013 15:04:02 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 2F1F0A8065; Mon, 10 Jun 2013 17:03:56 +0200 (CEST) Received: from steludxu1397.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.279.5; Mon, 10 Jun 2013 17:04:02 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [PATCH 01/12] mmc: core: Remove unnecessary check for the remove callback Date: Mon, 10 Jun 2013 17:03:36 +0200 Message-ID: <1370876627-13439-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> References: <1370876627-13439-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmjeB7BGmhSwQZvHh8bZ7c10/xPHqSbGXL1tPFiZNjz0PZS6ewq3hviLHYlBDbwiHug6Gys X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Ulf Hansson For every bus_ops type the .remove callback always exist, thus there are no need to check the existence of it, before we decide to call it. Signed-off-by: Ulf Hansson Tested-by: Jaehoon Chung --- drivers/mmc/core/core.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index e9a104b..d2ee282 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -2483,9 +2483,7 @@ void mmc_stop_host(struct mmc_host *host) mmc_bus_get(host); if (host->bus_ops && !host->bus_dead) { /* Calling bus_ops->remove() with a claimed host can deadlock */ - if (host->bus_ops->remove) - host->bus_ops->remove(host); - + host->bus_ops->remove(host); mmc_claim_host(host); mmc_detach_bus(host); mmc_power_off(host); @@ -2638,8 +2636,7 @@ int mmc_suspend_host(struct mmc_host *host) * bus_ops->remove() with a claimed host can * deadlock.) */ - if (host->bus_ops->remove) - host->bus_ops->remove(host); + host->bus_ops->remove(host); mmc_claim_host(host); mmc_detach_bus(host); mmc_power_off(host); @@ -2722,9 +2719,7 @@ int mmc_pm_notify(struct notifier_block *notify_block, break; /* Calling bus_ops->remove() with a claimed host can deadlock */ - if (host->bus_ops->remove) - host->bus_ops->remove(host); - + host->bus_ops->remove(host); mmc_claim_host(host); mmc_detach_bus(host); mmc_power_off(host);