LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] drm/mediatek: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
@ 2017-11-21 22:31 Vasyl Gomonovych
  2017-11-23  9:31 ` Philipp Zabel
  0 siblings, 1 reply; 3+ messages in thread
From: Vasyl Gomonovych @ 2017-11-21 22:31 UTC (permalink / raw)
  To: ck.hu, p.zabel, airlied, matthias.bgg, dri-devel
  Cc: linux-arm-kernel, linux-mediatek, linux-kernel, gomonovych

Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).

drivers/gpu/drm/mediatek/mtk_drm_gem.c:223:9-16: WARNING: ERR_CAST can be used with mtk_gem
Generated by: scripts/coccinelle/api/err_cast.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
index f595ac816b55..5766b42fc174 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
@@ -220,7 +220,7 @@ struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev,
 	mtk_gem = mtk_drm_gem_init(dev, attach->dmabuf->size);
 
 	if (IS_ERR(mtk_gem))
-		return ERR_PTR(PTR_ERR(mtk_gem));
+		return ERR_CAST(mtk_gem));
 
 	expected = sg_dma_address(sg->sgl);
 	for_each_sg(sg->sgl, s, sg->nents, i) {
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/mediatek: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
  2017-11-21 22:31 [PATCH] drm/mediatek: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Vasyl Gomonovych
@ 2017-11-23  9:31 ` Philipp Zabel
  2018-04-25  5:48   ` CK Hu
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Zabel @ 2017-11-23  9:31 UTC (permalink / raw)
  To: Vasyl Gomonovych, ck.hu, airlied, matthias.bgg, dri-devel
  Cc: linux-arm-kernel, linux-mediatek, linux-kernel

On Tue, 2017-11-21 at 23:31 +0100, Vasyl Gomonovych wrote:
> Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).
> 
> drivers/gpu/drm/mediatek/mtk_drm_gem.c:223:9-16: WARNING: ERR_CAST can be used with mtk_gem
> Generated by: scripts/coccinelle/api/err_cast.cocci
> 
> Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> index f595ac816b55..5766b42fc174 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> @@ -220,7 +220,7 @@ struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev,
>  	mtk_gem = mtk_drm_gem_init(dev, attach->dmabuf->size);
>  
>  	if (IS_ERR(mtk_gem))
> -		return ERR_PTR(PTR_ERR(mtk_gem));
> +		return ERR_CAST(mtk_gem));
>  
>  	expected = sg_dma_address(sg->sgl);
>  	for_each_sg(sg->sgl, s, sg->nents, i) {

Acked-by: Philipp Zabel <p.zabel@pengutronix.de>

regards
Philipp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/mediatek: Use ERR_CAST instead of ERR_PTR(PTR_ERR())
  2017-11-23  9:31 ` Philipp Zabel
@ 2018-04-25  5:48   ` CK Hu
  0 siblings, 0 replies; 3+ messages in thread
From: CK Hu @ 2018-04-25  5:48 UTC (permalink / raw)
  To: Vasyl Gomonovych
  Cc: Philipp Zabel, airlied, matthias.bgg, dri-devel,
	linux-arm-kernel, linux-mediatek, linux-kernel

Hi, Vasyl:

Sorry for the late reply.
I've applied this to my branch mediatek-drm-next-4.18

Regards,
CK

On Thu, 2017-11-23 at 17:31 +0800, Philipp Zabel wrote:
> On Tue, 2017-11-21 at 23:31 +0100, Vasyl Gomonovych wrote:
> > Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...)).
> > 
> > drivers/gpu/drm/mediatek/mtk_drm_gem.c:223:9-16: WARNING: ERR_CAST can be used with mtk_gem
> > Generated by: scripts/coccinelle/api/err_cast.cocci
> > 
> > Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
> > ---
> >  drivers/gpu/drm/mediatek/mtk_drm_gem.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_gem.c b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> > index f595ac816b55..5766b42fc174 100644
> > --- a/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_gem.c
> > @@ -220,7 +220,7 @@ struct drm_gem_object *mtk_gem_prime_import_sg_table(struct drm_device *dev,
> >  	mtk_gem = mtk_drm_gem_init(dev, attach->dmabuf->size);
> >  
> >  	if (IS_ERR(mtk_gem))
> > -		return ERR_PTR(PTR_ERR(mtk_gem));
> > +		return ERR_CAST(mtk_gem));
> >  
> >  	expected = sg_dma_address(sg->sgl);
> >  	for_each_sg(sg->sgl, s, sg->nents, i) {
> 
> Acked-by: Philipp Zabel <p.zabel@pengutronix.de>
> 
> regards
> Philipp
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-25  5:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-21 22:31 [PATCH] drm/mediatek: Use ERR_CAST instead of ERR_PTR(PTR_ERR()) Vasyl Gomonovych
2017-11-23  9:31 ` Philipp Zabel
2018-04-25  5:48   ` CK Hu

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).