Skip to contentSkip to conversation

drm/omap: Use ERR_CAST directly instead of RR_PTR(PTR_ERR())

PATCH In review zhong jiang 3 participants 3 messages Sep 11, 2018 – Sep 26, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/omap: Use ERR_CAST directly instead of RR_PTR(PTR_ERR())

We prefer to use ERR_CAST to do so.
The issue is detected with the help of Coccinelle.

---
 drivers/gpu/drm/omapdrm/dss/dss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/dss/dss.c +1 -1
index cb80dda..1fc46b2 100644
@@ -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;
Signature · 1 line
1.7.12.4
Reviewed-by on v1 1/1
#1 lore raw

Hi Zhong Jiang,

Thank you for the patch.

Quoted 4 lines · On Tuesday, 11 September 2018 14:54:35 EEST zhong jiang wrote:

We prefer to use ERR_CAST to do so.
The issue is detected with the help of Coccinelle.

I expect Tomi to take this patch in his tree, but I also applied it to mine to make sure it won't be forgotten.

Quoted 17 lines
---
 drivers/gpu/drm/omapdrm/dss/dss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/omapdrm/dss/dss.c index cb80dda..1fc46b2 100644

drivers/gpu/drm/omapdrm/dss/dss.c +1 -1
@@ -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;
Signature · 3 lines
Regards,

Laurent Pinchart
#2 lore raw
In reply to zhong jiang
Quoted 14 lines · zhong jiang

We prefer to use ERR_CAST to do so.
The issue is detected with the help of Coccinelle.

---
 drivers/gpu/drm/omapdrm/dss/dss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/dss/dss.c +0 -0
index cb80dda..1fc46b2 100644

drivers/gpu/drm/omapdrm/dss/dss.c struct dss_debugfs_entry * · line 962

Quoted 8 lines
drivers/gpu/drm/omapdrm/dss/dss.c +1 -1
@@ -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;

Thanks, picked this up.

Tomi

Signature · 2 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki