Skip to contentSkip to conversation

iommu/omap: Remove casting the return value which is a void pointer

PATCH In review Jingoo Han 2 participants 2 messages Sep 9, 2013 – Sep 12, 2013 IOMMU

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 iommu/omap: 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/iommu/omap-iopgtable.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/omap-iopgtable.h +1 -1
index f4003d5..b6f9a51 100644
@@ -95,4 +95,4 @@ static inline phys_addr_t omap_iommu_translate(u32 d, u32 va, u32 mask)
 #define iopte_offset(iopgd, da)	(iopgd_page_vaddr(iopgd) + iopte_index(da))
 
 #define to_iommu(dev)							\
-	((struct omap_iommu *)platform_get_drvdata(to_platform_device(dev)))
+	(platform_get_drvdata(to_platform_device(dev)))
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 5 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.

Thanks, LGTM.

Quoted 15 lines
---
 drivers/iommu/omap-iopgtable.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/omap-iopgtable.h +1 -1
index f4003d5..b6f9a51 100644
@@ -95,4 +95,4 @@ static inline phys_addr_t omap_iommu_translate(u32 d, u32 va, u32 mask)
 #define iopte_offset(iopgd, da)	(iopgd_page_vaddr(iopgd) + iopte_index(da))
 
 #define to_iommu(dev)							\
-	((struct omap_iommu *)platform_get_drvdata(to_platform_device(dev)))
+	(platform_get_drvdata(to_platform_device(dev)))