Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp628343ima; Wed, 24 Oct 2018 06:53:04 -0700 (PDT) X-Google-Smtp-Source: AJdET5fz57Ck2hoXzVVLA2Y9ZaX5SYV5VnEJ0+OQL6sBMvIMNjoJhNG8kKbsmqf8UZq50LUZ/xnq X-Received: by 2002:a63:b54f:: with SMTP id u15mr2620049pgo.420.1540389184654; Wed, 24 Oct 2018 06:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540389184; cv=none; d=google.com; s=arc-20160816; b=Ek1C9rS2jjGAdbD0p1Mici/qHOSCZkC7mg1opqHW7p3xqrYGgS6vltOJ4KI0lU440q ru/Vbhf73bdDjDAoLQHcYcHAkHPt8CxFELq5rYGxM65tUJABOAMO3GCXyQozFSIMjp4t RTneENUJAYk4NZTdN8QNeQwCmjJcyL0yXjsGpPKtej+pKfVAT/C3iuAfdHuJDKawnRiC t+DjZaBh8CgWVISNrHExXOBwH8oPr1BIiht2kZ98tZJfrDh/2NRYpBONrDSdcR3qX2+F o8GPPRut/u2ACbxfyaq7JRQHhFASARjrqhJyR8BhVDqfGaFImWiq4RzHKYasaM179VsF R12w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature; bh=UwCxgTY7tIBBn3y37lNQQ/aQwUmlWJFHLrrsMY5uiQQ=; b=dIDAgAztuv/HcIFeo7Ylz/DcWBuIWIEaKgDyHQw3cZOEEfN1DiHuHn3H++j2TMBr1z Ln+SyHjOoOzZVeAWQfTO01WTmVCVapsnjY+6LanfE1Eli+vwOvhVz6/q+nO/FAe4Fw21 YIe/IraEDGjLo2q5q6y7AAT9bbjk74PXYX8KqGPAHK9AGPRHr1ap9F3UXp6hRQot6yv5 jT98a3w4pJZBU1oobG0o3BliOcvGW9gzlFFZTSEN3PpXkmFZwttVZGMcT3MboMO2ZXI0 ComZQov2U9ofyBVXNMVV+/sRJfROawsu4xBSmOnHSvQBtorNouzL3GRBhSH669Nzs5CG FRwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Klgv3cvd; 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 k123-v6si5084866pfc.150.2018.10.24.06.52.48; Wed, 24 Oct 2018 06:53:04 -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=Klgv3cvd; 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 S1726748AbeJXWSz (ORCPT + 99 others); Wed, 24 Oct 2018 18:18:55 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:46034 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbeJXWSz (ORCPT ); Wed, 24 Oct 2018 18:18:55 -0400 Received: by mail-io1-f68.google.com with SMTP id p83-v6so3163718iod.12 for ; Wed, 24 Oct 2018 06:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UwCxgTY7tIBBn3y37lNQQ/aQwUmlWJFHLrrsMY5uiQQ=; b=Klgv3cvdarNNMSvtAMDWSQuOdEJ/r2H/JjMSErEkNUU6meA6alzJ2GJ6/hpjFzu6rI cZELeefJMnqLx1pI1cN8zV0hlZqicJ2IbR8NzjfFRby9bc87BT8Kaodf/mwqxUZHRbJ3 UEKmzB7aCOtt4dBn8bVbFxUX6Sa4rkWZnIjYI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UwCxgTY7tIBBn3y37lNQQ/aQwUmlWJFHLrrsMY5uiQQ=; b=XK49Jgf1ib1gcoswzCo9LoaO33Dq3JSe0YKN6jr8TAXqOaeytCne9TYMGnwOJwDu6i xZukZxB1VamnB/6BdIgoykm/+IJrOApo4su7YirFaCOIcentXdRhRa/D48/MgmIDl3+K 2KZ9Inmq6Fg69M5plbWX5fCdu1209HlTz642bS0qdBOmYi9KdxO+Lyc83u3YvhIWhBDy kqbr43o540oMKwpTfCOkHMYcgjRHRXkcFJc4MQ9wfsGAl9y7mqbulMN3DwMurPsfsK9F VyOp70ZPlejaunNr/kQRRGmVt6lE5k0FL1w7xxhclmv+MX0CfmGjeLu1LvyB7Tzrrslm gn/w== X-Gm-Message-State: AGRZ1gI7ZY2TIOgV0q1BcLzSR4p60TkXVp/lITd2ShmHW5vCPCy3ZMON OO+l490iJXIFlHDp3P9Nf0chQTmEJ+skqg9J/27w8w== X-Received: by 2002:a6b:b487:: with SMTP id d129-v6mr14009360iof.131.1540389042691; Wed, 24 Oct 2018 06:50:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3941:0:0:0:0:0 with HTTP; Wed, 24 Oct 2018 06:50:02 -0700 (PDT) In-Reply-To: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> References: <1540368084-32202-1-git-send-email-zhang.chunyan@linaro.org> From: Ulf Hansson Date: Wed, 24 Oct 2018 15:50:02 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci: Convert sdhci_allocate_bounce_buffer() to return void To: Chunyan Zhang Cc: Adrian Hunter , Linux Kernel Mailing List , Linux ARM , Linus Walleij , Chunyan Zhang Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24 October 2018 at 10:01, Chunyan Zhang wrote: > 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 This looks good to me, however please re-post to linux-mmc. Kind regards Uffe > --- > 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 >