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: 149484 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp243064ljp; Wed, 24 Oct 2018 00:19:39 -0700 (PDT) X-Google-Smtp-Source: AJdET5eYgS+mROZYL2umZGmR6Ybx4VWIJW0o6wbhFBVFOGFQeRE6dyki3ly9gdtotQKmQQQDv5Es X-Received: by 2002:a62:60c1:: with SMTP id u184-v6mr1565034pfb.114.1540365579776; Wed, 24 Oct 2018 00:19:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540365579; cv=none; d=google.com; s=arc-20160816; b=Y8bg40jAbgR4Du9buyF5fDCStKLItEjXoimE0NkNpSnMMg1jeLcKvbF3rYNwoTkZrP ixCPJBEoqTv5pcGTScYtZepyKcT1TUhhgPnZxGvNR7RpapN5GoUrDJyg/PhbJQWOZ0Qh F2BnhDLnyzxIUA8Z/xROB99O43S9u/rjmia8n0F3Iz0wmR9uDm0YwLLwBrx2V5h0UBp4 VwrTMaGrP6tyo7N46HFasRBECJDVczJOydMilLge2RJXftL3qcgN5wLQzBeIg6dy4ity yr+Wxw3Gb+VJBPw6FWLnE9iGxa5ddBokNK5UL312P1RG7oej5mYI1JvtFP8+K7+3VH1O tg6A== 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=Q0OxaD93i6DMOsE0lB4H8lwK5cE/aUBEWyXDpUuRFn4HIR0NvKFqgAP3INimJN1UFZ 1ELS7zf5t7Kq2lnNTu9QtyXmDg42Zziji1PQvqYpaygdvJbBQ71dBeWDHE/jFGRqEAzk pq37z8Td9wCTlxtq48G5I4HUSOaXE4+h4uj5Dj5YyVXpxnSM0R33KfvJKgmxh5nGjgUm Vwc4aVcv3FBGTQsxY0Ez2wx0DuO50ranWl7WmS8Ze6sD40ZbTbBXqQK3LPVJsq5CIlk1 lVRSMtg+tq2a/7sh56axIJFHOfwUizGC7pZtaO4vYuFwa269N2h7AP3LkvnxH6pr7jI3 IUfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RpPJBl1f; 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 q13-v6si3715956pgq.526.2018.10.24.00.19.39; Wed, 24 Oct 2018 00:19:39 -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=RpPJBl1f; 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 S1727020AbeJXPq0 (ORCPT + 32 others); Wed, 24 Oct 2018 11:46:26 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:45260 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbeJXPq0 (ORCPT ); Wed, 24 Oct 2018 11:46:26 -0400 Received: by mail-pg1-f196.google.com with SMTP id s3-v6so1890366pga.12 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=uT7Pr46xYHyyBRapwVz+WlDlwPOAaXNyFACtU3JsWZhkybAbz8M5XZ/TVqxk0j3lld 2Kx/jZ4gsAOl7U7SWSq6TA4yPltu9dkIdwqf6B6yjBnBZkTBAqvWDA79xeO2KgJZ5eea /wM3qWLdMHQKyPqNit6Z3N2fpIS0Dj1PWDH1j6NmaymiyjRgUJbxmm4gCTAz1nUgOqyR 2G6Iggtm3dVfnjWGQGXCbIm7p8A60RQwoMMFqfUqpVEr/l8WutddOsfVwYdFzG9whiU+ HQMUk/GP1Azm9kpVmpHWS+uiQWSt5vbTT88pqI8vuUYxCRO53cy0F8g7rO8lHlKB1HBM ameQ== X-Gm-Message-State: AGRZ1gLinqMUwESe6GNxhFwumGD96AreIxeIcT9WUhqsLsOfrC2ckJjl neRGDq5+2lSaqiXR+JEeRBTP4Q== 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 Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Linus Walleij , Chunyan Zhang 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 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 Reviewed-by: Linus Walleij 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;