Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp3437012ima; Tue, 23 Oct 2018 06:03:15 -0700 (PDT) X-Google-Smtp-Source: AJdET5fKEzLbHkihdxt/OidqOzh46wy6KO6B8T6JxAyuvWEu0tuBaLfvIhctfPjMpIVl9pNJUcT2 X-Received: by 2002:a17:902:e00a:: with SMTP id ca10-v6mr6309487plb.166.1540299795853; Tue, 23 Oct 2018 06:03:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540299795; cv=none; d=google.com; s=arc-20160816; b=Bg1rRkbvBv6QSx3tVVA64ZD1RQo33Kts2u/9urgMF3VrUX9oc7eAqrFKukbmUS7k2H Cquu1X+JbOGR8J0Ld4dBl3y9mLd9qO5Hhu1zYHShLkzZigXn3k+Cl/AwuhXmcI0Nir5O JHGmwJKmuhL4IVnlSvUJHQT0mkvfr3jJyBmm7NNHWNnrUf8yivqvH34t5Wj7qKbAOGQw 5p8+VoBmcO6InEHd9d6QYdbFchTMJCWkPQd0G2wKgGyIrL7dNRMbYkLc4SvHvaP4RFMu I4tB298ONmOU5M+h+tTh8lDpSVmKim+XXzxfORI+uvN1nFyav1IdS7J1Dzy7CNwJ2AdP IItA== 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=NPIUALSoQMb4v7EO9qELFWSAsHu6NJEZ3OBI9YB6DNw=; b=BWcLMfvNrUI+CgmNzMQcTJ4J+6Kud3rfZ3bSXMzVIb+an53MvuCHvjRL45w4mXF6/V t0DS1h0/rxJWlD4mfdnO0xoioiuPG9Kmy8LE/XpHaYdY7i/oHntrtUDDSisN00aXXAw+ 67rZ2X97DbjQ1EOkP4HfFVnYgWsLcNbfJ64YkOjiijQS/OU2m3v1vPMsFcdJjHXRgNZk t1W9I2bS9Bix9HmgONMnJAJixWlIK8A1bcUVG+vdtysGOY3UeYwmaDvN2OIAduYljbha vir/PUVipy9XiIbOSliT7AkBQxg64Klf5QoVpzmJ+NvECiDWVLXspDSBrJeuQp6Nx5sr 4zpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PaJON69B; 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 s130-v6si1337923pfc.81.2018.10.23.06.02.57; Tue, 23 Oct 2018 06:03:15 -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=PaJON69B; 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 S1728112AbeJWVZs (ORCPT + 99 others); Tue, 23 Oct 2018 17:25:48 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:50779 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728008AbeJWVZr (ORCPT ); Tue, 23 Oct 2018 17:25:47 -0400 Received: by mail-it1-f193.google.com with SMTP id k206-v6so1787689ite.0 for ; Tue, 23 Oct 2018 06:02:24 -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=NPIUALSoQMb4v7EO9qELFWSAsHu6NJEZ3OBI9YB6DNw=; b=PaJON69BEY/JcNzPagaujT1/j9cStc3mCjB5t4x1X9JwPP2j5M/XNWI5F7V+M1wLZk /mt665Cz4XCj54aaha9vA9UHLvlZ8IM5+jtgIQJnTlHPOvdJwcUZ/S4IdmSB8fVWqPgV v7gytL5fTelcAUu1ehRbRnOm52vrzky3I1wjk= 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=NPIUALSoQMb4v7EO9qELFWSAsHu6NJEZ3OBI9YB6DNw=; b=Rc5OYxNCl87IKjHWZDwumZ6Jxn6WiwHRoAqTjVLAVjkN6RT+BacucHV6WsXiqR/4xh GtBTokgIq+OmxAXozfwlOVGAKmKt+7d2kkabp0OmWO6QCsRm+8gTsBgtaXJzBzLIysbx vcmGvTToxbG/W6qeFjn1r6V2IhQpslS6vkMrAwJU0YcnsKldN2SMetqQLg71J06lqtWM qrmstrHILbHl+B65QJ1HIdFhOkPcTpQoRArjaJViJUSF9AuOYZXUuTJxGe/j2Opaerob jd1e8h28Cx9eb56YVgZP7eib/m4Q4jnlvNTwyE13acFiKKDAU5AqXeqYTfX4aF9i/DV6 c7Ww== X-Gm-Message-State: ABuFfojAHXi/J9k6XNBjK2rDP4TMixDdWndXNGhaqBZyOFyCGwINfrVU ZluUTHHmtgGfpJ1Ztv5foUl1Jpp7JBJmdam0w+sOwg== X-Received: by 2002:a02:2b29:: with SMTP id h41-v6mr12418234jaa.12.1540299743554; Tue, 23 Oct 2018 06:02:23 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:3941:0:0:0:0:0 with HTTP; Tue, 23 Oct 2018 06:01:43 -0700 (PDT) In-Reply-To: <1539677982-13762-1-git-send-email-zhang.chunyan@linaro.org> References: <1539677982-13762-1-git-send-email-zhang.chunyan@linaro.org> From: Ulf Hansson Date: Tue, 23 Oct 2018 15:01:43 +0200 Message-ID: Subject: Re: [PATCH] mmc: sdhci: use goto rather than return directly To: Chunyan Zhang Cc: Adrian Hunter , "linux-mmc@vger.kernel.org" , Linux Kernel Mailing List , 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 16 October 2018 at 10:19, Chunyan Zhang wrote: > The driver should clean resources requested in the function before > unnormal return. > > CC: Linus Walleij > Signed-off-by: Chunyan Zhang > Fixes: bd9b902798ab ("mmc: sdhci: Implement an SDHCI-specific bounce buffer") > --- > drivers/mmc/host/sdhci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c > index 1b3fbd9..f6b57e1 100644 > --- a/drivers/mmc/host/sdhci.c > +++ b/drivers/mmc/host/sdhci.c > @@ -3991,7 +3991,7 @@ int sdhci_setup_host(struct sdhci_host *host) > /* This may alter mmc->*_blk_* parameters */ > ret = sdhci_allocate_bounce_buffer(host); > if (ret) > - return ret; > + goto unreg; Instead of making the error path a bit more complicated, I suggest to convert sdhci_allocate_bounce_buffer() from returning an int to a void. Simply because it always returns 0 and thus we can remove this error path altogether. > } > > return 0; > -- > 2.7.4 > Kind regards Uffe