From patchwork Thu May 30 12:53:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 17292 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5C1325C6D for ; Thu, 30 May 2013 12:53:36 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id z20sf225886yhz.4 for ; Thu, 30 May 2013 05:53:36 -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=FTr1zuA5a1sztU/yLej+cijiBgoQG9HPiy63AZBqyzo=; b=pqn3MtDHhr4x6ZrJ9jqLLj8q5jbjSjRxxxNJ9QKThPGqV0h85wsqHpaCZ6tMojqa// Z6O5MpRsumSYzoQ3tk53MdB52M72CdYC9q68L51yHKcyUTtK/5l/+O4x1LwPH7iEOEdO 2PmlTmoCnLdJLhIP1j1VfOnOBI62qyRblj0w6mP4VvugvGhfZBJilH/39bBPiNThLx6P BCCXCtivrvT7tSJtYuL8psQ70MZ7WlFy1Cy0iYWFCXAc39PGvdGgtVdIqEI2JJsCnS8W 6NvYCav2xZWSnw3rTR6IpwavLLKyQYW8O+jiJdV4MRvooDS9vUD6mOS+dvqiKzZysa2H 5CBQ== X-Received: by 10.236.230.72 with SMTP id i68mr3716691yhq.23.1369918416036; Thu, 30 May 2013 05:53:36 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.207 with SMTP id t15ls352071qeq.36.gmail; Thu, 30 May 2013 05:53:35 -0700 (PDT) X-Received: by 10.52.24.242 with SMTP id x18mr4523226vdf.128.1369918415818; Thu, 30 May 2013 05:53:35 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id ha8si24731140vdb.61.2013.05.30.05.53.35 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 30 May 2013 05:53:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.176 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.176; Received: by mail-vc0-f176.google.com with SMTP id ha11so121892vcb.21 for ; Thu, 30 May 2013 05:53:35 -0700 (PDT) X-Received: by 10.58.225.228 with SMTP id rn4mr5300142vec.35.1369918415651; Thu, 30 May 2013 05:53:35 -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.220.229.199 with SMTP id jj7csp6722vcb; Thu, 30 May 2013 05:53:35 -0700 (PDT) X-Received: by 10.14.215.137 with SMTP id e9mr9766458eep.44.1369918414479; Thu, 30 May 2013 05:53:34 -0700 (PDT) Received: from eu1sys200aog118.obsmtp.com (eu1sys200aog118.obsmtp.com [207.126.144.145]) by mx.google.com with SMTP id 8si26471671eeg.229.2013.05.30.05.53.32 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 30 May 2013 05:53:34 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.145 is neither permitted nor denied by best guess record for domain of ulf.hansson@stericsson.com) client-ip=207.126.144.145; Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob118.postini.com ([207.126.147.11]) with SMTP ID DSNKUadLyvkQBtlujrGN2EUPb5l7vh1loLsc@postini.com; Thu, 30 May 2013 12:53:34 UTC Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 73A511B1; Thu, 30 May 2013 12:53:16 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 5BB364AB0; Thu, 30 May 2013 12:52:59 +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 E9ACFA8065; Thu, 30 May 2013 14:53:10 +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; Thu, 30 May 2013 14:53:16 +0200 From: Ulf Hansson To: , Chris Ball Cc: Ulf Hansson Subject: [PATCH 1/4] mmc: core: Remove unnecessary check for the remove callback Date: Thu, 30 May 2013 14:53:08 +0200 Message-ID: <1369918391-15277-2-git-send-email-ulf.hansson@stericsson.com> X-Mailer: git-send-email 1.7.10 In-Reply-To: <1369918391-15277-1-git-send-email-ulf.hansson@stericsson.com> References: <1369918391-15277-1-git-send-email-ulf.hansson@stericsson.com> MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlL+846a34yx8EjmICmFoDJR9C+/1Erf85aQGtT4xlcIM4/4RCjglnhdBBJZjNiDMLx5S95 X-Original-Sender: patch@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.176 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 --- 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);