From: Sam Ravnborg <sam@ravnborg.org>
To: Wang Qing <wangqing@vivo.com>
Cc: Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Jordan Crouse <jcrouse@codeaurora.org>,
Jonathan Marek <jonathan@marek.ca>,
Akhil P Oommen <akhilpo@codeaurora.org>,
Sharat Masetty <smasetty@codeaurora.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: Use IS_ERR() instead of null pointer check
Date: Fri, 6 Nov 2020 19:52:02 +0100 [thread overview]
Message-ID: <20201106185202.GA808798@ravnborg.org> (raw)
In-Reply-To: <1604629881-557-1-git-send-email-wangqing@vivo.com>
Hi Wang.
Thanks for the fix.
On Fri, Nov 06, 2020 at 10:31:19AM +0800, Wang Qing wrote:
> a6xx_gmu_get_mmio() never return null in case of error, but ERR_PTR(),
> so we should use IS_ERR() instead of null pointer check
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>
In the future please put "drm/<driver-dir>:" in the subject.
See git log . in said directory for normal practice - this let the
readers see this is an msm related patch.
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index 491fee4..8c81a89
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -492,7 +492,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
> void __iomem *seqptr = a6xx_gmu_get_mmio(pdev, "gmu_pdc_seq");
> uint32_t pdc_address_offset;
>
> - if (!pdcptr || !seqptr)
> + if (IS_ERR(pdcptr) || IS_ERR(seqptr))
> goto err;
When the pointer is checked after the err: label the function
IS_ERR_OR_NULL() is used. Please update both places so they match.
Sam
>
> if (adreno_is_a618(adreno_gpu) || adreno_is_a640(adreno_gpu))
> --
> 2.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Wang Qing <wangqing@vivo.com>
Cc: freedreno@lists.freedesktop.org,
Jonathan Marek <jonathan@marek.ca>,
David Airlie <airlied@linux.ie>,
linux-arm-msm@vger.kernel.org,
Sharat Masetty <smasetty@codeaurora.org>,
dri-devel@lists.freedesktop.org,
Akhil P Oommen <akhilpo@codeaurora.org>,
Sean Paul <sean@poorly.run>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm: Use IS_ERR() instead of null pointer check
Date: Fri, 6 Nov 2020 19:52:02 +0100 [thread overview]
Message-ID: <20201106185202.GA808798@ravnborg.org> (raw)
In-Reply-To: <1604629881-557-1-git-send-email-wangqing@vivo.com>
Hi Wang.
Thanks for the fix.
On Fri, Nov 06, 2020 at 10:31:19AM +0800, Wang Qing wrote:
> a6xx_gmu_get_mmio() never return null in case of error, but ERR_PTR(),
> so we should use IS_ERR() instead of null pointer check
>
> Signed-off-by: Wang Qing <wangqing@vivo.com>
In the future please put "drm/<driver-dir>:" in the subject.
See git log . in said directory for normal practice - this let the
readers see this is an msm related patch.
> ---
> drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> index 491fee4..8c81a89
> --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c
> @@ -492,7 +492,7 @@ static void a6xx_gmu_rpmh_init(struct a6xx_gmu *gmu)
> void __iomem *seqptr = a6xx_gmu_get_mmio(pdev, "gmu_pdc_seq");
> uint32_t pdc_address_offset;
>
> - if (!pdcptr || !seqptr)
> + if (IS_ERR(pdcptr) || IS_ERR(seqptr))
> goto err;
When the pointer is checked after the err: label the function
IS_ERR_OR_NULL() is used. Please update both places so they match.
Sam
>
> if (adreno_is_a618(adreno_gpu) || adreno_is_a640(adreno_gpu))
> --
> 2.7.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-11-06 18:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 2:31 [PATCH] drm: Use IS_ERR() instead of null pointer check Wang Qing
2020-11-06 2:31 ` Wang Qing
2020-11-06 18:52 ` Sam Ravnborg [this message]
2020-11-06 18:52 ` Sam Ravnborg
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=20201106185202.GA808798@ravnborg.org \
--to=sam@ravnborg.org \
--cc=airlied@linux.ie \
--cc=akhilpo@codeaurora.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=jcrouse@codeaurora.org \
--cc=jonathan@marek.ca \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=smasetty@codeaurora.org \
--cc=wangqing@vivo.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.