iio: light: apds9306: remove redundant explicit pointer cast
Subsystems (2)
PATCH 1/1 iio: light: apds9306: remove redundant explicit pointer cast
C allows implicit conversion from void * to struct apds9306_data *, so the explicit cast on 'ptr' is unnecessary. Removing it improves readability.
--- drivers/iio/light/apds9306.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/apds9306.c +1 -1
@@ -1176,7 +1176,7 @@ static int apds9306_init_iio_gts(struct apds9306_data *data)static void apds9306_powerdown (void *ptr) { -struct apds9306_data *data = (struct apds9306_data *)ptr; +struct apds9306_data *data = ptr;struct apds9306_regfields *rf = &data->rf;int ret;
Signature · 1 line
2.52.0
Quoted 13 lines · SAJJA EASWAR SAI
C allows implicit conversion from void * to struct
apds9306_data*, so the explicit cast on 'ptr' is unnecessary. Removing it improves readability.Signed-off-by SAJJA EASWAR SAI <[email protected]>--- drivers/iio/light/apds9306.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/apds9306.c +0
-0
drivers/iio/light/apds9306.c static int apds9306_init_iio_gts(struct apds9306_data *data) · line 1182
Quoted 8 lines
drivers/iio/light/apds9306.c +1
-1@@ -1176,7 +1176,7 @@ static int apds9306_init_iio_gts(struct apds9306_data *data)static void apds9306_powerdown (void *ptr) { -struct apds9306_data *data = (struct apds9306_data *)ptr; +struct apds9306_data *data = ptr;struct apds9306_regfields *rf = &data->rf;int ret;
Looks good. Thank you.
Regards,
Subhajit Ghosh
Jonathan Cameron
maintainerQuoted 5 lines · On Fri, 30 Jan 2026 09:14:41 +1030 Subhajit Ghosh…
Quoted 4 lines · SAJJA EASWAR SAI
C allows implicit conversion from void * to struct
apds9306_data*, so the explicit cast on 'ptr' is unnecessary. Removing it improves readability.Signed-off-by SAJJA EASWAR SAI <[email protected]>
Applied to the testing branch of iio.git.
Thanks,
Jonathan
Quoted 23 lines
Quoted 9 lines
--- drivers/iio/light/apds9306.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/light/apds9306.c +0
-0drivers/iio/light/apds9306.c static int apds9306_init_iio_gts(struct apds9306_data *data) · line 1182
Quoted 8 lines
drivers/iio/light/apds9306.c +1
-1@@ -1176,7 +1176,7 @@ static int apds9306_init_iio_gts(struct apds9306_data *data)static void apds9306_powerdown (void *ptr) { -struct apds9306_data *data = (struct apds9306_data *)ptr; +struct apds9306_data *data = ptr;struct apds9306_regfields *rf = &data->rf;int ret;Looks good. Thank you.
Acked-by Subhajit Ghosh <[email protected]>Regards,
Subhajit Ghosh