From: Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
To: Jingoo Han <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: 'Ohad Ben-Cohen' <ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org>,
'Linux IOMMU'
<iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
Subject: Re: [PATCH] iommu/omap: Remove casting the return value which is a void pointer
Date: Fri, 29 Aug 2014 10:45:44 +0200 [thread overview]
Message-ID: <2739938.JszcTL34D3@avalon> (raw)
In-Reply-To: <004e01cfc33c$03b26230$0b172690$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.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 <jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> ---
> 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
next prev parent reply other threads:[~2014-08-29 8:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-29 3:47 [PATCH] iommu/omap: Remove casting the return value which is a void pointer Jingoo Han
[not found] ` <004e01cfc33c$03b26230$0b172690$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-08-29 8:45 ` Laurent Pinchart [this message]
[not found] <005601cead1e$ffe78470$ffb68d50$%han@samsung.com>
[not found] ` <005601cead1e$ffe78470$ffb68d50$%han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-09-12 22:30 ` Suman Anna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2739938.JszcTL34D3@avalon \
--to=laurent.pinchart-rylnwiuwjnjg/c1bvhzhaw@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=jg1.han-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=ohad-Ix1uc/W3ht7QT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox