Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp261070ima; Wed, 24 Oct 2018 00:21:34 -0700 (PDT) X-Google-Smtp-Source: AJdET5fHqekqFqHLmScwVMMiPFtzSlqH7pfZn2OUNBjaSaB7hRMeqcleYZ9sZDC2eSQK0wRo31kv X-Received: by 2002:a17:902:6a83:: with SMTP id n3-v6mr1480987plk.288.1540365694142; Wed, 24 Oct 2018 00:21:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540365694; cv=none; d=google.com; s=arc-20160816; b=qqZa/chbQmqmpK34tDGCuP4LdnXdRDsDFM7ZFwZek0AkOXc87/6NnKLb59MhAY4BbM EZKLHX5pgumJVTmmT1mjLFF8y3I2IVPc/OQfgYcYw+YAdn4C8BDt2NnuMOriiUfhvguH 8QaG3GVg5YaAbkQxxe97bMyri2OlYrNnFgpD8ZaDiB0Q78BbPtsP4ssuPrCVOlSrO6GJ U5oAd7XGIdhSHLJXV3kTf+HQ/PBxk4EDKFh1v4gTWVox+uxjhBjNNID5D7YQrBD4nm37 wZwYga07KrwdXshv6ZaO2FPlxQOd9iq7o0doyTiehze8D4Ew2pCC8KCIqDzaAEfNg/Nd ERWA== 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 w14-v6si3429675plq.327.2018.10.24.00.21.18; Wed, 24 Oct 2018 00:21:34 -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 S1726913AbeJXPq0 (ORCPT + 99 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(-) 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; -- 2.7.4