From patchwork Wed Oct 24 07:19: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: 10654197 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 9A3AC13A4 for ; Wed, 24 Oct 2018 07:20:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 843842A658 for ; Wed, 24 Oct 2018 07:20:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74F832A663; Wed, 24 Oct 2018 07:20:03 +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 122C32A658 for ; Wed, 24 Oct 2018 07:20:02 +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=YmY fmEYJcgDeZDdQoHLfOkAjjxV/ZDd2BOQfB1Xa8rODaE2Vy8t9VoT3kxlGa8i/JD2BTE9tvS8a9oLe G3W3crOoL3C6jxSVP26Fgd8l3iXokgZSgO/C7kCcOr5VY/0CtkezfV3MEbEkXRWz+v3kOlM1b+elH 79DYlphuMLfQRvmwjdFvVjV+dErZah8T0xQVKGCVLgP/fjna9Wj9Wt/ZsEavR4eAZUOCThfBaE2gz NPgk3wlg3OynpxOoT25UzyO/Cc0adQ4QKsQhern78oXSNLpZH9KtcfZc+KVtajMWG7L2AbtxDsfbu 7yfdran7iojuQ879VF7eDKwSFwB9sCw==; 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 1gFDSJ-0001SX-Lg; Wed, 24 Oct 2018 07:19:51 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gFDSG-0001Ok-Gw for linux-arm-kernel@lists.infradead.org; Wed, 24 Oct 2018 07:19:49 +0000 Received: by mail-pg1-x541.google.com with SMTP id r9-v6so1902180pgv.6 for ; Wed, 24 Oct 2018 00:19:37 -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=RpPJBl1fDo/7KGPRXj+10cEfzqnP/GDfyBd76eYV2r1mttD+B8i+L2TLAjB47hwWed VNQwErQzti2JqdrtHL1AbHJYhqXiMd3rw0tFn4zSIQ+KF2nUfeUahtqc/yrAyyLCI3XM pETs1TFgGGncQg0/XkG6eeX9DEBn9m5HiQIxo= 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=SAO3h1rjYMclQr+RS91c80++Jpt3eJ/kPKgk7BaQHyA4gnVMer7MpX78iNdmZfCNK5 EX6zddCvh6xA8QJTbkHxb9xy+4ss6r4SV+V+LzT8oLw7U9Qk/90THu85idb1w23c0gKl thVvSqHzMkhQgaDWry3i91pZNGLRqwqzdmofmwxxfbGPFMJTx8heY9Btg48V+LVOidn6 B31HYpEeUicXKXKQkDiwxMnAEsLFf9cKl5ArDGdk+1cepBdzA+h1aFNA+To7ttLC8Cpf gG0lZppVXYtZGQ2xDNFSh/1k2Vrj0vavr9GSV+lV8zhO6hA2Ly1kDzFwz/hwqKtyurlK /WBg== X-Gm-Message-State: AGRZ1gLFZS5JQQcjMrbqJOlvqIdTqEXufxinpS7IIEadd5eg6X2KYBTY txXx1kUmC9mw6MdXgqOQYVcpfQ== X-Google-Smtp-Source: AJdET5dJ7E4uAQxZO9m16w7UnVLFBRKPHmr2pUr9o/ReSKOTkYiQkuuPUQ6nEmk5q38J7yY3+EE94g== X-Received: by 2002:a65:5608:: with SMTP id l8-v6mr1480665pgs.433.1540365577104; Wed, 24 Oct 2018 00:19:37 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id n64-v6sm5707035pfi.185.2018.10.24.00.19.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 00:19:35 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Subject: [PATCH] mmc: sdhci: Conver sdhci_allocate_bounce_buffer() to return void Date: Wed, 24 Oct 2018 15:19:24 +0800 Message-Id: <1540365564-30645-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_001948_564391_04209CBF 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 Reviewed-by: Linus Walleij --- 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;