iio: dac: ad5504: Remove unnecessary cast on void pointer
Subsystems (2)
PATCH 1/1 iio: dac: ad5504: Remove unnecessary cast on void pointer
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 <[email protected]>
--- drivers/iio/dac/ad5504.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/dac/ad5504.c +1 -1
@@ -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 ; }
Signature · 1 line
2.7.4
Quoted 18 lines · simran 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
)
Quoted 1 line
Signed-off-by simran singhal <[email protected]>
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.
Quoted 18 lines
--- drivers/iio/dac/ad5504.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/dac/ad5504.c +1
-1@@ -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 ; }