iommu/omap: Remove casting the return value which is a void pointer
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.
Signed-off-by Jingoo Han <[email protected]>
--- drivers/iommu/omap-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iommu/omap-iommu.c +1 -2
@@ -34,8 +34,7 @@#include "omap-iopgtable.h" #include "omap-iommu.h" -#define to_iommu (dev) \ - ((struct omap_iommu *)platform_get_drvdata(to_platform_device(dev))) +#define to_iommu (dev) platform_get_drvdata(to_platform_device(dev))#define for_each_iotlb_cr (obj, n, __i, cr) \ for (__i = 0; \
Signature · 1 line
2.0.0
A message that is not in the archive (sent off-list or not yet received): 004e01cfc33c$03b26230$0b172690$%[email protected]
Hi Jingoo,
Thank you for the patch.
Quoted 3 lines · On Friday 29 August 2014 12:47:54 Jingoo Han wrote:
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.
I agree with that, but the explicit cast helps making sure we don't assign the value of to_iommu(dev) to a non struct omap_iommu pointer by mistake.
Quoted 19 lines
Signed-off-by Jingoo Han <[email protected]>--- drivers/iommu/omap-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)drivers/iommu/omap-iommu.c +1
-2@@ -34,8 +34,7 @@#include "omap-iopgtable.h" #include "omap-iommu.h" -#define to_iommu (dev) \ - ((struct omap_iommu *)platform_get_drvdata(to_platform_device(dev))) +#define to_iommu (dev) platform_get_drvdata(to_platform_device(dev))#define for_each_iotlb_cr (obj, n, __i, cr) \ for (__i = 0; \
Signature · 3 lines
Regards, Laurent Pinchart