From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH] iommu/omap: Remove casting the return value which is a void pointer Date: Fri, 29 Aug 2014 10:45:44 +0200 Message-ID: <2739938.JszcTL34D3@avalon> References: <004e01cfc33c$03b26230$0b172690$%han@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <004e01cfc33c$03b26230$0b172690$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Jingoo Han Cc: 'Ohad Ben-Cohen' , 'Linux IOMMU' List-Id: iommu@lists.linux-foundation.org Hi Jingoo, Thank you for the patch. 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. > Signed-off-by: Jingoo Han > --- > drivers/iommu/omap-iommu.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c > index e202b0c24120..02ef0ace7386 100644 > --- a/drivers/iommu/omap-iommu.c > +++ b/drivers/iommu/omap-iommu.c > @@ -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; \ -- Regards, Laurent Pinchart