From patchwork Wed Oct 24 08:01:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 10654351 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 DC0B414BB for ; Wed, 24 Oct 2018 08:02:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB2252A089 for ; Wed, 24 Oct 2018 08:02:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF4242A093; Wed, 24 Oct 2018 08:02:01 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3979E2A089 for ; Wed, 24 Oct 2018 08:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=TeupPdvFPmSA5Y9KGkk9qYJB+aq1G8pGpZZBRFEOOYw=; b=hkC 2kGuGBAmlJRxN8S8cz4GG54fNpCXM37PNWxoPH/a1JrRQ4fyJx5GiiUI/M8qm8NkbyYCHQLdqE8Dr /HZ4z1VSYUZdfttAPygKJ2vME0PGI/nDRqNBFkov2IWL+ZxV5q/ldEvKhFTpTA/8OxYu+TnP5DUaG 3935Tn4oTmw9vH0t7ujEsHjQhmaUoS9Wh3WmglN8ELaziy9QJ6oVSPI6Iseza4yW6XGv6k2C3CUYS 46krOi7lvB9Lmm2db5YLdJh2V8knoP1k3fLFbpIKvEWnpFjjTT6a6Y4oZy1Oe9QslQLNh3DeLyuS0 FAfD8zuOAEjMt3zwKlO/WhAilUUfAQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFE72-0007Bp-Rj; Wed, 24 Oct 2018 08:01:56 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFE6y-0007AF-AU for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2018 08:01:55 +0000 Received: by mail-pl1-x643.google.com with SMTP id d23-v6so1868278pls.11 for ; Wed, 24 Oct 2018 01:01:42 -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; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=Xcn/jYWXh81tB7zFOyRmQkfxygest239hGEdHnATb5SOizedBC5t28MrgBM+OvJ2LY V9xSr96BjCgJZFKKEMP/E1u0oZ6mFhoP5Rc6zvVtVdP1WFf+FTXNTjSQ/iywaOyM2SMD G/+CfIc8BZE06H0e11kDQ0o44c8oskH79sHGQ= 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; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=XETVOukRII1y3zcFFkhlImkIFvsbpuvJbpOueeXMItcwsVOlGgON2dA26KkZIJi4iG sfMLVd+3MJGvD/L2DGYo6uni5EK/t3aUBOi6bt9+5ah8dIn9hnwFa0uXwC7qUNRwGUYO 8XECRLX+T2dw+QnlUdWeJNYArkZUasY0eB4fLiJig43yNfKkX3gvUdALzbK/ovKZ5ySv 9EWN3qVO7JK66vkGPAAD26pojHmPBtgT0wbaxloiA5dxNggaUTgzmOUcq2Y4H5RXZyQl 1dZnhyZiTINmg80cnsnkqDJXFIrn/F+nkySxavu3X+TNO8IXup/Ri+5BC8fyjD/lZrgT 3WGQ== X-Gm-Message-State: AGRZ1gK76aKc29nInpZxuCv8rxKPl+0MoZHC2cS/TWQF7v1BiVMrx5kg MNRaEKUv+MbM8P0SmmnMZ/JzXQ== X-Google-Smtp-Source: AJdET5eWg+JGFllyer/VRZzTkHRck+UOgANGR+FdeV2oSWN9KhcIjdIoWhfQfEJHCfNULczATbqASg== X-Received: by 2002:a17:902:bf44:: with SMTP id u4-v6mr1591650pls.48.1540368101663; Wed, 24 Oct 2018 01:01:41 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id d2-v6sm4299086pfn.118.2018.10.24.01.01.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 01:01:40 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Subject: [PATCH] mmc: sdhci: Convert sdhci_allocate_bounce_buffer() to return void Date: Wed, 24 Oct 2018 16:01:24 +0800 Message-Id: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181024_010152_362226_54819CE4 X-CRM114-Status: GOOD ( 13.75 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chunyan Zhang , Linus Walleij , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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;