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: 149485 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp276253ljp; Wed, 24 Oct 2018 01:01:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5fadw4+AcbjIr03xT/LVdvU4BdxleAF+42GGzfM13C3JpUcuUKzKgZ5QfAIWkV7He6C15+x X-Received: by 2002:a62:1e42:: with SMTP id e63-v6mr1629678pfe.149.1540368104780; Wed, 24 Oct 2018 01:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540368104; cv=none; d=google.com; s=arc-20160816; b=JTHW6Jpl1nSqYaTDerktfsntZrb6zIATYJsn3fzuEFlzANGK2IH/dAaxaV0W5FyA8U VbY0o4cwXWLF57Egqy8lKMvzEMyjquCNRpycbzDEPqYoFk4mn2czjkpfO/KLUObDNZ2+ LaZIuuRwXzfFieewNNI0HafjDxtEeTjf7MaDKlWjiqAbVVkLKFC7wRLhyM5la9PwVlej i8nNoY7sPab831ICDfhcCzTQL8kbZ71wCgpyatTobo0P/ZfVCYzgYmKiCaJdkFgwgmf3 6tBgE30pMASHHe1wx2RCzeItv/wj4N3HIK+Q2Zye395USo1/z7Si9e1cZQXyTxLAB5Kf 7EIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=CprYVBSfSEewVE9BSNcV+g6IEsT3adhH74xDx8e1TGjjWWSNqudy+rmcy7PSDFWLdq mVbwGTRvLiB2IoadHyyDDp45+YwoDo15JtupZvtZvc9KLV3uFYQSUconAa0cSAQaX9gY Wr/wTLReDUS4FaSZH7pZTwT5wUAdgsa8iEK1OB8yite71hLRK5MJztk56EB4+R4a/wfa eIV1AIrdvSXYUOzinPp7nnsZF9B/4fSzWXb1BUrHYPEhHciBF4L2J5dp1i/x8zYXA22i EhAnJNG4tpuko5wt96P+Iqaib3O7Q6jKH6iyz4y3q6HA/MlbOd0GB0TgaLVWEt+H8pjK UiNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xcn/jYWX"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k16-v6si3856690pls.40.2018.10.24.01.01.44; Wed, 24 Oct 2018 01:01:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Xcn/jYWX"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727535AbeJXQ2n (ORCPT + 32 others); Wed, 24 Oct 2018 12:28:43 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:35970 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726964AbeJXQ2m (ORCPT ); Wed, 24 Oct 2018 12:28:42 -0400 Received: by mail-pl1-f194.google.com with SMTP id y11-v6so1889742plt.3 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=kCtpkWPd+sv9sgBpshjlwXb00xvolKVEPkSkewutF4kD0UjRiao2Ddu8jBQ0Pb0yWn fg/9RlO0+KHkPgdVMed7PCrZyNmxtXpxj5j3Irbpzn8w0/2A0q5O4VJPieZQEOdWf1up furGYpVn7WsJ3mNPZPX21EVhyjje0mfqEP2HqmaPvSBbwI77jZly+wV4FzNfCHLo7wjY 3ihce7KLjgsQ7bPe+kRqr/P/r/Q25aDrf6/ofMgS9GOxkshftS1K/c+K7ulanHzHxhrK SSpaqSO82YcpXWCOcQLUhHPKSegHLaFObrLfCT7A97NJ4CqWcfGGp+1L+bh4X2r9HzgR UDzg== X-Gm-Message-State: AGRZ1gKHLcyNnsXWEDTvBitrbJP1E8kCFl+Xpah6GQpCYa2tTlw8mDZb EZsYqIxyVtfebhpT4+mLvmuHag== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Chunyan Zhang 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4 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;