From: Jonathan Cameron <jic23@kernel.org>
To: simran singhal <singhalsimran0@gmail.com>, lars@metafoo.de
Cc: Michael Hennerich <Michael.Hennerich@analog.com>,
Hartmut Knaack <knaack.h@gmx.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: dac: ad5504: Remove unnecessary cast on void pointer
Date: Sun, 2 Apr 2017 09:50:02 +0100 [thread overview]
Message-ID: <7a4d91fe-9401-f799-0e72-9b3431aa7ac3@kernel.org> (raw)
In-Reply-To: <20170401141153.GA26918@singhal-Inspiron-5558>
On 01/04/17 15:11, simran singhal wrote:
> The following Coccinelle script was used to detect this:
> @r@
> expression x;
> void* e;
> type T;
> identifier f;
> @@
> (
> *((T *)e)
> |
> ((T *)x)[...]
> |
> ((T*)x)->f
> |
> - (T*)
> e
> )
>
> Signed-off-by: simran singhal <singhalsimran0@gmail.com>
It could be argued for this one that it is acting as documentation
as it might not be obvious without looking up the definition of
the iio_get_time_ns function that it takes a struct iio_dev.
However, on balance I think that this case is simple enough that
it should be fine as you have it.
Applied.
> ---
> drivers/iio/dac/ad5504.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5504.c b/drivers/iio/dac/ad5504.c
> index 22a027d..712d86b 100644
> --- a/drivers/iio/dac/ad5504.c
> +++ b/drivers/iio/dac/ad5504.c
> @@ -223,7 +223,7 @@ static irqreturn_t ad5504_event_handler(int irq, void *private)
> 0,
> IIO_EV_TYPE_THRESH,
> IIO_EV_DIR_RISING),
> - iio_get_time_ns((struct iio_dev *)private));
> + iio_get_time_ns(private));
>
> return IRQ_HANDLED;
> }
>
prev parent reply other threads:[~2017-04-02 8:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 14:11 simran singhal
2017-04-02 8:50 ` Jonathan Cameron [this message]
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=7a4d91fe-9401-f799-0e72-9b3431aa7ac3@kernel.org \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=singhalsimran0@gmail.com \
/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
all inboxes | Powered by JetHome®