From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ulf Hansson <ulf.hansson@linaro.org>, Carlo Caione <carlo@endlessm.com>
Cc: Carlo Caione <carlo@caione.org>,
Kevin Hilman <khilman@baylibre.com>,
linux-mmc@vger.kernel.org, linux-amlogic@lists.infradead.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH 2/2] mmc: meson-mx-sdio: Cleanup IS_ERR() checks
Date: Fri, 13 Oct 2017 14:20:49 +0300 [thread overview]
Message-ID: <20171013112049.rdcdqv6ooktlv5wz@mwanda> (raw)
In-Reply-To: <20171013111943.zyp5myiwb3pp56vh@mwanda>
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>
---
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;
next prev parent reply other threads:[~2017-10-13 11:22 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 ` Dan Carpenter [this message]
2017-10-13 19:02 ` [PATCH 2/2] mmc: meson-mx-sdio: Cleanup IS_ERR() checks Martin Blumenstingl
2017-10-20 10:02 ` Ulf Hansson
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=20171013112049.rdcdqv6ooktlv5wz@mwanda \
--to=dan.carpenter@oracle.com \
--cc=carlo@caione.org \
--cc=carlo@endlessm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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).