From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Cc: David Airlie <airlied@linux.ie>,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Chen-Yu Tsai <wens@csie.org>, Daniel Vetter <daniel@ffwll.ch>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] drm/sun4i: fix warning PTR_ERR_OR_ZERO can be used
Date: Sun, 26 May 2019 21:19:40 +0200 [thread overview]
Message-ID: <20190526191940.ddr2yd7szfidtiu2@flea> (raw)
In-Reply-To: <20190525072509.GA6979@hari-Inspiron-1545>
[-- Attachment #1.1: Type: text/plain, Size: 1694 bytes --]
Hi!
On Sat, May 25, 2019 at 12:55:09PM +0530, Hariprasad Kelam wrote:
> fix below warnings reported by coccicheck
>
> ./drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c:174:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c:236:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c:285:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c:142:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
> ./drivers/gpu/drm/sun4i/sun4i_dotclock.c:198:1-3: WARNING:
> PTR_ERR_OR_ZERO can be used
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
> ---
> drivers/gpu/drm/sun4i/sun4i_dotclock.c | 4 +---
> drivers/gpu/drm/sun4i/sun4i_hdmi_ddc_clk.c | 4 +---
> drivers/gpu/drm/sun4i/sun4i_hdmi_i2c.c | 4 +---
> drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 4 +---
> drivers/gpu/drm/sun4i/sun8i_hdmi_phy_clk.c | 4 +---
> 5 files changed, 5 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/sun4i/sun4i_dotclock.c b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
> index 2a15f2f..e0fd19d 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_dotclock.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_dotclock.c
> @@ -195,10 +195,8 @@ int sun4i_dclk_create(struct device *dev, struct sun4i_tcon *tcon)
> dclk->hw.init = &init;
>
> tcon->dclk = clk_register(dev, &dclk->hw);
> - if (IS_ERR(tcon->dclk))
> - return PTR_ERR(tcon->dclk);
>
> - return 0;
> + return PTR_ERR_OR_ZERO(tcon->dclk);
Unfortunately, that was on purpose. It's much easier to extend if we
ever need to change anything there.
Maxime
--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 176 bytes --]
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2019-05-26 19:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-25 7:25 [PATCH] drm/sun4i: fix warning PTR_ERR_OR_ZERO can be used Hariprasad Kelam
2019-05-26 19:19 ` Maxime Ripard [this message]
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=20190526191940.ddr2yd7szfidtiu2@flea \
--to=maxime.ripard@bootlin.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hariprasad.kelam@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wens@csie.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