Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1314473ima; Wed, 24 Oct 2018 19:13:27 -0700 (PDT) X-Google-Smtp-Source: AJdET5dULnQIBT5vi5Xr2cVpVsvNjCjYkZOMcLNjad5S0Tw6TQwlEVe/ckkYp2xagBMC95yDeFuQ X-Received: by 2002:a17:902:758f:: with SMTP id j15-v6mr4864591pll.160.1540433607480; Wed, 24 Oct 2018 19:13:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540433607; cv=none; d=google.com; s=arc-20160816; b=mqzzvC6Wiyw5Mv3/Zvcthaj0OxgTYGiJmGjfMsNd2beBgrEln6IbfKnf7AC/raXB8K QupbXGCp0DXfC4D09GApN7YJvsYVlteTLwsDCvCSZQnd4OspStaHuCKALRzVmzRgTKbg bPk8y9mgYk0YyEgLCfPSfW0NSlw499KkfP+uU0OMnKtPH2ChuHi0MOAp9zYF/szPLQwy Pdoya2CKfSYJqjFQPHwShP0dyTwK+pizBvvYDB+uvWHPkUyXIMDyW55A9Mc4UAJ9vFoy F60WWZ1gvhPYCQ5zFYoHts12nWRi7IoywmoUSEeNNG7DrBuramuWtr2MZw3XLrsFQbaq cayQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=gm1eW3gmjLBN6vPdfZUeFaaQ2ewiXMWfLn+c0OgD4nXPz71i/ttzKvoV70o4gWXTma XBImt5ZbiaEghmW6g0Vsyc4r/lkgOJmslSpZq5y5VTmMf6TnAZT62dSUPVHO3i3B0iym 3f8zzUjmsKYP0ZdOimoey/CuMRgIJwjv5EuWjr4ynAXH7aLgZFN6Q1tF/Jw/B4V4kLKQ rXjcVQmQtb50zXKSW7hpyklzooNz0+uAEL1bljrAXTmwo9QLk3lbi6YPSg08sYwAR7vo 1jS4Q+bgVeJKXYe9hRL6SvfNpOM3GkxrQ3kXjgsmppnyh6gf50MTOcNbINeUgnuAlVNQ PZ8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Sz9GRZx/"; 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 k4-v6si4003874pgm.202.2018.10.24.19.13.10; Wed, 24 Oct 2018 19:13:27 -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="Sz9GRZx/"; 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 S1727126AbeJYKn1 (ORCPT + 99 others); Thu, 25 Oct 2018 06:43:27 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:43502 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbeJYKn0 (ORCPT ); Thu, 25 Oct 2018 06:43:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id n10-v6so2509209pgv.10 for ; Wed, 24 Oct 2018 19:12:50 -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:in-reply-to:references; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=Sz9GRZx/Z3W1V9DG8tnhf1G3va/hoZE4OzcWh0q2cIGBJ7IEycmiIrXPXwnDNDYZbm p6v0IT1Qg+oq3ski7EE/oAK6GWBRlHT4kpoh3WSPxXG3XxToQzZ7HMr/60F976U1gxel n8PfrBaPC72Ye5aNbW3BPh5j6yKMbxRc3emA0= 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:in-reply-to :references; bh=LU33Gsa2HCKv9HOvNZu+bYf6MApf/+vgJR72mmhToLI=; b=PGbuRC/YZdvF4mDJSUGNln1V1LREd9hmq1r51gcEuVL0zsNsMFLL6w7fdusp7OjBz1 9B0YwlcuPfjFQ3qa2UIyEoA8UacG+S80PU7HdO7AzjRadX5kBcygoWtq349x5z20eguZ OZBpZKF2r0ZkDTwSjKQxHwxHM8wY5BxDauWzY95cUA+CKgzmihA6ZH5k1+1RvZyFmKf6 L3fs/9wkl92Eg6wgJ9XaUbaRxuNAUdtuL1+wG+ASc/G978N2kG0didCdH9fTmnZ2PORO o5co+ENgT0yJmEz9lj5Sn0MA7yZzV1uQZPCXp2ktnB8M9SMosliI7kIlUOXo8941p5vH dm3A== X-Gm-Message-State: AGRZ1gJUSy7wXgTFBdS+f4wWNaYfyUoOQEAExLxxke/VryWnOdpKwU13 Hdd5WaRHD78f+g3mM4g+fo88WA== X-Received: by 2002:a63:a612:: with SMTP id t18-v6mr4752671pge.338.1540433570183; Wed, 24 Oct 2018 19:12:50 -0700 (PDT) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id i5-v6sm6661824pgs.10.2018.10.24.19.12.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 Oct 2018 19:12:49 -0700 (PDT) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Linus Walleij , Chunyan Zhang Subject: [PATCH] mmc: sdhci: Convert sdhci_allocate_bounce_buffer() to return void Date: Thu, 25 Oct 2018 10:12:36 +0800 Message-Id: <1540433556-12261-1-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> References: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> 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