From patchwork Thu Oct 25 02:12:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10655349 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A933813BF for ; Thu, 25 Oct 2018 02:12:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 952DE2B760 for ; Thu, 25 Oct 2018 02:12:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8848E2B762; Thu, 25 Oct 2018 02:12:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 28AD42B760 for ; Thu, 25 Oct 2018 02:12:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726443AbeJYKn0 (ORCPT ); Thu, 25 Oct 2018 06:43:26 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43003 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726236AbeJYKn0 (ORCPT ); Thu, 25 Oct 2018 06:43:26 -0400 Received: by mail-pg1-f194.google.com with SMTP id i4-v6so3235633pgq.9 for ; Wed, 24 Oct 2018 19:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=Sz9GRZx/Z3W1V9DG8tnhf1G3va/hoZE4OzcWh0q2cIGBJ7IEycmiIrXPXwnDNDYZbm p6v0IT1Qg+oq3ski7EE/oAK6GWBRlHT4kpoh3WSPxXG3XxToQzZ7HMr/60F976U1gxel n8PfrBaPC72Ye5aNbW3BPh5j6yKMbxRc3emA0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=F1bzVINwDtJdOfxJX0lsykviiX88M4K65VdFVbsb1o9vm3NU6Ib36T8w1FwrPHJczw 25lBaHGErGop3BEG3mw1Gm0mAFH6X3ts908zibbo+jDaXh279l+x9OS2J0a9QJiQPCZ6 9qtORp4Ea37TlhAJ1tELwOJbKkQjhrgLrVV8CPc8LLMsxhdVWz5IniKiytAPAKt7FoGQ lpDtDQNOVpOGUoP9BwGTd6722bOlyMRw/lgbpnsR7LhWJQ5bN0Vcsl932iHuhuYU3a64 Qdb3hRe3CH//jwTZyLBlC554iHGMuZ3Ymd2preYN5U7WgxkhmoYF0MmrsVeYiIv/OJ2J eWqQ== X-Gm-Message-State: AGRZ1gLWaQdCGn/CnC7Lo+nwztpvS182cNl5B+ENzwf7v7dU47Olu/W6 UbK2iNxVZSw4Xkd/l5N9nhB09w== X-Google-Smtp-Source: AJdET5fy1SO4iwXT2/6T/z6PXWU9JeKdSa9PSzxHQxP1p30/5bXUXykRSim6QCpWQT7MeqoABqK0hg== X-Received: by 2002:a63:a612:: with SMTP id t18-v6mr4752671pge.338.1540433570183; Wed, 24 Oct 2018 19:12:50 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id i5-v6sm6661824pgs.10.2018.10.24.19.12.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 19:12:49 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Chunyan Zhang Subject: [PATCH] mmc: sdhci: Convert sdhci_allocate_bounce_buffer() to return void Date: Thu, 25 Oct 2018 10:12:36 +0800 Message-Id: <1540433556-12261-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> References: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The function sdhci_allocate_bounce_buffer() always return zero at present, so there's no need to have a return value, that will also make error path easier. CC: Linus Walleij Signed-off-by: Chunyan Zhang --- drivers/mmc/host/sdhci.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1b3fbd9..e94f4aa 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3408,7 +3408,7 @@ void __sdhci_read_caps(struct sdhci_host *host, u16 *ver, u32 *caps, u32 *caps1) } EXPORT_SYMBOL_GPL(__sdhci_read_caps); -static int sdhci_allocate_bounce_buffer(struct sdhci_host *host) +static void sdhci_allocate_bounce_buffer(struct sdhci_host *host) { struct mmc_host *mmc = host->mmc; unsigned int max_blocks; @@ -3446,7 +3446,7 @@ static int sdhci_allocate_bounce_buffer(struct sdhci_host *host) * Exiting with zero here makes sure we proceed with * mmc->max_segs == 1. */ - return 0; + return; } host->bounce_addr = dma_map_single(mmc->parent, @@ -3456,7 +3456,7 @@ static int sdhci_allocate_bounce_buffer(struct sdhci_host *host) ret = dma_mapping_error(mmc->parent, host->bounce_addr); if (ret) /* Again fall back to max_segs == 1 */ - return 0; + return; host->bounce_buffer_size = bounce_size; /* Lie about this since we're bouncing */ @@ -3466,8 +3466,6 @@ static int sdhci_allocate_bounce_buffer(struct sdhci_host *host) pr_info("%s bounce up to %u segments into one, max segment size %u bytes\n", mmc_hostname(mmc), max_blocks, bounce_size); - - return 0; } int sdhci_setup_host(struct sdhci_host *host) @@ -3987,12 +3985,9 @@ int sdhci_setup_host(struct sdhci_host *host) */ mmc->max_blk_count = (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535; - if (mmc->max_segs == 1) { + if (mmc->max_segs == 1) /* This may alter mmc->*_blk_* parameters */ - ret = sdhci_allocate_bounce_buffer(host); - if (ret) - return ret; - } + sdhci_allocate_bounce_buffer(host); return 0;