linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpu: Use ERR_CAST to replace ERR_PTR(PTR_ERR())
@ 2018-08-18 10:57 zhong jiang
  2018-08-19 10:49 ` Laurent Pinchart
  0 siblings, 1 reply; 2+ messages in thread
From: zhong jiang @ 2018-08-18 10:57 UTC (permalink / raw)
  To: tomi.valkeinen, airlied; +Cc: sre, laurent.pinchart, afd, linux-kernel

We prefer to ERR_CAST rather than ERR_PTR(PTR_ERR()), So just
replace it.

The issue is detected with the help of Coccinelle

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/gpu/drm/omapdrm/dss/dss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index cb80dda..1fc46b2 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -956,7 +956,7 @@ struct dss_debugfs_entry *
 				&dss_debug_fops);
 	if (IS_ERR(d)) {
 		kfree(entry);
-		return ERR_PTR(PTR_ERR(d));
+		return ERR_CAST(d);
 	}
 
 	entry->dentry = d;
-- 
1.7.12.4


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

* Re: [PATCH] gpu: Use ERR_CAST to replace ERR_PTR(PTR_ERR())
  2018-08-18 10:57 [PATCH] gpu: Use ERR_CAST to replace ERR_PTR(PTR_ERR()) zhong jiang
@ 2018-08-19 10:49 ` Laurent Pinchart
  0 siblings, 0 replies; 2+ messages in thread
From: Laurent Pinchart @ 2018-08-19 10:49 UTC (permalink / raw)
  To: zhong jiang; +Cc: tomi.valkeinen, airlied, sre, afd, linux-kernel

Hi Zhong Jiang,

Thank you for the patch.

On Saturday, 18 August 2018 13:57:12 EEST zhong jiang wrote:
> We prefer to ERR_CAST rather than ERR_PTR(PTR_ERR()), So just
> replace it.
> 
> The issue is detected with the help of Coccinelle
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/gpu/drm/omapdrm/dss/dss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c
> b/drivers/gpu/drm/omapdrm/dss/dss.c index cb80dda..1fc46b2 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dss.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dss.c
> @@ -956,7 +956,7 @@ struct dss_debugfs_entry *
>  				&dss_debug_fops);
>  	if (IS_ERR(d)) {
>  		kfree(entry);
> -		return ERR_PTR(PTR_ERR(d));
> +		return ERR_CAST(d);
>  	}
> 
>  	entry->dentry = d;

-- 
Regards,

Laurent Pinchart




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

end of thread, other threads:[~2018-08-19 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-18 10:57 [PATCH] gpu: Use ERR_CAST to replace ERR_PTR(PTR_ERR()) zhong jiang
2018-08-19 10:49 ` Laurent Pinchart

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