Skip to contentSkip to conversation

mtd: plat-ram: Remove casting the return value which is a void pointer

PATCH Applied Jingoo Han 2 participants 2 messages Sep 9, 2013 – Oct 2, 2013 Memory technology devices (MTD)

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 mtd: plat-ram: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

---
 drivers/mtd/maps/plat-ram.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/plat-ram.c +1 -1
index 6762716..3e35b9a 100644
@@ -55,7 +55,7 @@ struct platram_info {
 
 static inline struct platram_info *to_platram_info(struct platform_device *dev)
 {
-	return (struct platram_info *)platform_get_drvdata(dev);
+	return platform_get_drvdata(dev);
 }
 
 /* platram_setrw
Signature · 1 line
1.7.10.4
Applied
#1 lore raw
Quoted 14 lines · Jingoo Han

Casting the return value which is a void pointer is redundant. The conversion from void pointer to any other pointer type is guaranteed by the C programming language.

---
 drivers/mtd/maps/plat-ram.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/maps/plat-ram.c +0 -0
index 6762716..3e35b9a 100644

drivers/mtd/maps/plat-ram.c struct platram_info { · line 61

Quoted 8 lines
drivers/mtd/maps/plat-ram.c +1 -1
@@ -55,7 +55,7 @@ struct platram_info {
 
 static inline struct platram_info *to_platram_info(struct platform_device *dev)
 {
-	return (struct platram_info *)platform_get_drvdata(dev);
+	return platform_get_drvdata(dev);
 }
 
 /* platram_setrw

Pushed to l2-mtd.git. Thanks!

Brian