Re: [PATCH] staging: iio: Remove unnecessary cast on void pointer

2018-03-07 Thread Jonathan Cameron
On Wed, 7 Mar 2018 18:47:17 +0530
Arushi 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: Arushi Singhal 
Applied to the togreg branch of iio.git and pushed out as testing.git
for the autobuilders to play with it.

Thanks,

Jonathan

> ---
>  drivers/staging/iio/adc/ad7816.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/iio/adc/ad7816.c 
> b/drivers/staging/iio/adc/ad7816.c
> index bfe180a..bf76a86 100644
> --- a/drivers/staging/iio/adc/ad7816.c
> +++ b/drivers/staging/iio/adc/ad7816.c
> @@ -254,7 +254,7 @@ static const struct attribute_group 
> ad7816_attribute_group = {
>  static irqreturn_t ad7816_event_handler(int irq, void *private)
>  {
>   iio_push_event(private, IIO_EVENT_CODE_AD7816_OTI,
> -iio_get_time_ns((struct iio_dev *)private));
> +iio_get_time_ns(private));
>   return IRQ_HANDLED;
>  }
>  

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: iio: Remove unnecessary cast on void pointer

2018-03-07 Thread Arushi Singhal
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: Arushi Singhal 
---
 drivers/staging/iio/adc/ad7816.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c
index bfe180a..bf76a86 100644
--- a/drivers/staging/iio/adc/ad7816.c
+++ b/drivers/staging/iio/adc/ad7816.c
@@ -254,7 +254,7 @@ static const struct attribute_group ad7816_attribute_group 
= {
 static irqreturn_t ad7816_event_handler(int irq, void *private)
 {
iio_push_event(private, IIO_EVENT_CODE_AD7816_OTI,
-  iio_get_time_ns((struct iio_dev *)private));
+  iio_get_time_ns(private));
return IRQ_HANDLED;
 }
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel