linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Carlo Caione <carlo@endlessm.com>,
	Carlo Caione <carlo@caione.org>,
	Kevin Hilman <khilman@baylibre.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"open list:ARM/Amlogic Meson..."
	<linux-amlogic@lists.infradead.org>,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH 2/2] mmc: meson-mx-sdio: Cleanup IS_ERR() checks
Date: Fri, 20 Oct 2017 12:02:46 +0200	[thread overview]
Message-ID: <CAPDyKFrm_RmRid2hD=E2Pkf++FS2rZ30ONynVbJ6h_42xjUFqQ@mail.gmail.com> (raw)
In-Reply-To: <20171013112049.rdcdqv6ooktlv5wz@mwanda>

On 13 October 2017 at 13:20, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> Using PTR_ERR_OR_ZERO() instead of IS_ERR() works, but it's not how
> you're supposed to write these conditions.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
> I really hope it doesn't become a trend on to wrap all error checks in a
> WARN_ON() macro...
>
> diff --git a/drivers/mmc/host/meson-mx-sdio.c b/drivers/mmc/host/meson-mx-sdio.c
> index dc30ed5e964b..d0d921e0e589 100644
> --- a/drivers/mmc/host/meson-mx-sdio.c
> +++ b/drivers/mmc/host/meson-mx-sdio.c
> @@ -602,7 +602,7 @@ static int meson_mx_mmc_register_clks(struct meson_mx_mmc_host *host)
>
>         host->fixed_factor_clk = devm_clk_register(host->controller_dev,
>                                                  &host->fixed_factor.hw);
> -       if (WARN_ON(PTR_ERR_OR_ZERO(host->fixed_factor_clk)))
> +       if (WARN_ON(IS_ERR(host->fixed_factor_clk)))
>                 return PTR_ERR(host->fixed_factor_clk);
>
>         clk_div_parent = __clk_get_name(host->fixed_factor_clk);
> @@ -620,7 +620,7 @@ static int meson_mx_mmc_register_clks(struct meson_mx_mmc_host *host)
>
>         host->cfg_div_clk = devm_clk_register(host->controller_dev,
>                                               &host->cfg_div.hw);
> -       if (WARN_ON(PTR_ERR_OR_ZERO(host->cfg_div_clk)))
> +       if (WARN_ON(IS_ERR(host->cfg_div_clk)))
>                 return PTR_ERR(host->cfg_div_clk);
>
>         return 0;

  parent reply	other threads:[~2017-10-20 10:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 11:19 [PATCH 1/2] mmc: meson-mx-sdio: return correct error code Dan Carpenter
2017-10-13 11:20 ` [PATCH 2/2] mmc: meson-mx-sdio: Cleanup IS_ERR() checks Dan Carpenter
2017-10-13 19:02   ` Martin Blumenstingl
2017-10-20 10:02   ` Ulf Hansson [this message]
2017-10-13 18:58 ` [PATCH 1/2] mmc: meson-mx-sdio: return correct error code Martin Blumenstingl
2017-10-20 10:02 ` Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPDyKFrm_RmRid2hD=E2Pkf++FS2rZ30ONynVbJ6h_42xjUFqQ@mail.gmail.com' \
    --to=ulf.hansson@linaro.org \
    --cc=carlo@caione.org \
    --cc=carlo@endlessm.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).