Skip to contentSkip to conversation

iio: imu: inv_icm42600: Convert to uXX and sXX integer types

PATCH In review Andy Shevchenko 2 participants 6 messages Nov 9, 2025 – Feb 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: imu: inv_icm42600: Convert to uXX and sXX integer types

The driver code is full of intXX_t and uintXX_t types which is not the pattern we use in the IIO subsystem. Switch the driver to use kernel internal types for that. No functional changes.

---

Jonathan, what is the status of fixing the type for iio_push_to_buffers_with_timestamp()? This patch doesn't do that as I see no API has been fixed (and it seems the only one that uses the *intXX_t parameter).

 drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +1 -1
index 54760d8f92a2..9be5ade24501 100644
@@ -1209,7 +1209,7 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
 	ssize_t i, size;
 	unsigned int no;
 	const void *accel, *gyro, *timestamp;
-	const int8_t *temp;
+	const s8 *temp;
 	unsigned int odr;
 	int64_t ts_val;
 	/* buffer is copied to userspace, zeroing it to avoid any data leak */
Signature · 1 line
2.50.1
#1 lore raw
Quoted 7 lines · Andy Shevchenko

The driver code is full of intXX_t and uintXX_t types which is not the pattern we use in the IIO subsystem. Switch the driver to use kernel internal types for that. No functional changes.

---

Quoted 7 lines

Jonathan, what is the status of fixing the type for iio_push_to_buffers_with_timestamp()? This patch doesn't do that as I see no API has been fixed (and it seems the only one that uses the *intXX_t parameter).

 drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

FWIW,

$ git grep -l 'u\?int[0-9][0-9]\?_t' -- drivers/iio/
drivers/iio/accel/bmc150-accel-core.c
drivers/iio/accel/bmc150-accel.h
drivers/iio/accel/fxls8962af-core.c
drivers/iio/accel/hid-sensor-accel-3d.c
drivers/iio/accel/kionix-kx022a.c
drivers/iio/accel/kxcjk-1013.c
drivers/iio/accel/sca3000.c
drivers/iio/accel/sca3300.c
drivers/iio/accel/ssp_accel_sensor.c
drivers/iio/adc/ad4000.c
drivers/iio/adc/ad7791.c
drivers/iio/adc/ad7887.c
drivers/iio/adc/at91_adc.c
drivers/iio/adc/ingenic-adc.c
drivers/iio/adc/max1363.c
drivers/iio/adc/qcom-spmi-rradc.c
drivers/iio/adc/qcom-vadc-common.c
drivers/iio/adc/ti-ads7950.c
drivers/iio/adc/ti-tlc4541.c
drivers/iio/adc/xilinx-xadc-core.c
drivers/iio/adc/xilinx-xadc-events.c
drivers/iio/adc/xilinx-xadc.h
drivers/iio/chemical/scd4x.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_trace.h
drivers/iio/common/hid-sensors/hid-sensor-attributes.c
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
drivers/iio/common/ssp_sensors/ssp.h
drivers/iio/common/ssp_sensors/ssp_iio.c
drivers/iio/common/ssp_sensors/ssp_iio_sensor.h
drivers/iio/dac/ad3552r.c
drivers/iio/dac/ad5446.c
drivers/iio/dac/ad5449.c
drivers/iio/dac/ad5766.c
drivers/iio/dac/ad7303.c
drivers/iio/dac/ad8460.c
drivers/iio/dac/ds4424.c
drivers/iio/dac/ti-dac7612.c
drivers/iio/frequency/admv4420.c
drivers/iio/gyro/adis16136.c
drivers/iio/gyro/ssp_gyro_sensor.c
drivers/iio/humidity/ens210.c
drivers/iio/imu/adis16400.c
drivers/iio/imu/adis16460.c
drivers/iio/imu/adis16480.c
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
drivers/iio/imu/inv_mpu6050/inv_mpu_aux.h
drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
drivers/iio/industrialio-buffer.c
drivers/iio/light/ltr501.c
drivers/iio/light/rohm-bu27034.c
drivers/iio/light/si1133.c
drivers/iio/light/stk3310.c
drivers/iio/light/vcnl4000.c
drivers/iio/position/hid-sensor-custom-intel-hinge.c
drivers/iio/pressure/icp10100.c
drivers/iio/pressure/ms5611_core.c
drivers/iio/temperature/mlx90632.c
Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#2 lore raw
Quoted 13 lines · On Sun, 9 Nov 2025 21:33:53 +0200 Andy Shevchenko…
Quoted 12 lines · Andy Shevchenko

The driver code is full of intXX_t and uintXX_t types which is not the pattern we use in the IIO subsystem. Switch the driver to use kernel internal types for that. No functional changes.

---

Jonathan, what is the status of fixing the type for iio_push_to_buffers_with_timestamp()? This patch doesn't do that as I see no API has been fixed (and it seems the only one that uses the *intXX_t parameter).

Quoted 4 lines
Quoted 2 lines
 drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)  

FWIW,

That interface is supposed to be going away anyway in favour of iio_push_to_buffers_with_ts() which doesn't have that issue. I'd rather an effort was put in that direction than changing the types as part of that old interface.

Thanks,

Jonathan

Quoted 62 lines
$ git grep -l 'u\?int[0-9][0-9]\?_t' -- drivers/iio/
drivers/iio/accel/bmc150-accel-core.c
drivers/iio/accel/bmc150-accel.h
drivers/iio/accel/fxls8962af-core.c
drivers/iio/accel/hid-sensor-accel-3d.c
drivers/iio/accel/kionix-kx022a.c
drivers/iio/accel/kxcjk-1013.c
drivers/iio/accel/sca3000.c
drivers/iio/accel/sca3300.c
drivers/iio/accel/ssp_accel_sensor.c
drivers/iio/adc/ad4000.c
drivers/iio/adc/ad7791.c
drivers/iio/adc/ad7887.c
drivers/iio/adc/at91_adc.c
drivers/iio/adc/ingenic-adc.c
drivers/iio/adc/max1363.c
drivers/iio/adc/qcom-spmi-rradc.c
drivers/iio/adc/qcom-vadc-common.c
drivers/iio/adc/ti-ads7950.c
drivers/iio/adc/ti-tlc4541.c
drivers/iio/adc/xilinx-xadc-core.c
drivers/iio/adc/xilinx-xadc-events.c
drivers/iio/adc/xilinx-xadc.h
drivers/iio/chemical/scd4x.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_trace.h
drivers/iio/common/hid-sensors/hid-sensor-attributes.c
drivers/iio/common/inv_sensors/inv_sensors_timestamp.c
drivers/iio/common/ssp_sensors/ssp.h
drivers/iio/common/ssp_sensors/ssp_iio.c
drivers/iio/common/ssp_sensors/ssp_iio_sensor.h
drivers/iio/dac/ad3552r.c
drivers/iio/dac/ad5446.c
drivers/iio/dac/ad5449.c
drivers/iio/dac/ad5766.c
drivers/iio/dac/ad7303.c
drivers/iio/dac/ad8460.c
drivers/iio/dac/ds4424.c
drivers/iio/dac/ti-dac7612.c
drivers/iio/frequency/admv4420.c
drivers/iio/gyro/adis16136.c
drivers/iio/gyro/ssp_gyro_sensor.c
drivers/iio/humidity/ens210.c
drivers/iio/imu/adis16400.c
drivers/iio/imu/adis16460.c
drivers/iio/imu/adis16480.c
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
drivers/iio/imu/inv_mpu6050/inv_mpu_aux.c
drivers/iio/imu/inv_mpu6050/inv_mpu_aux.h
drivers/iio/imu/inv_mpu6050/inv_mpu_magn.c
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
drivers/iio/industrialio-buffer.c
drivers/iio/light/ltr501.c
drivers/iio/light/rohm-bu27034.c
drivers/iio/light/si1133.c
drivers/iio/light/stk3310.c
drivers/iio/light/vcnl4000.c
drivers/iio/position/hid-sensor-custom-intel-hinge.c
drivers/iio/pressure/icp10100.c
drivers/iio/pressure/ms5611_core.c
drivers/iio/temperature/mlx90632.c
maintainer
#3 lore raw
In reply to Andy Shevchenko
Quoted 3 lines · On Sun, 9 Nov 2025 20:24:36 +0100 Andy Shevchenko…

The driver code is full of intXX_t and uintXX_t types which is not the pattern we use in the IIO subsystem. Switch the driver to use kernel internal types for that. No functional changes.

No problem with the change but this description made me think that this was going to be a huge patch touching lots of instances.

Probably needs a rewrite to not say 'full of' :)

Quoted 25 lines

---

Jonathan, what is the status of fixing the type for iio_push_to_buffers_with_timestamp()? This patch doesn't do that as I see no API has been fixed (and it seems the only one that uses the *intXX_t parameter).

 drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c +1 -1
index 54760d8f92a2..9be5ade24501 100644
@@ -1209,7 +1209,7 @@ int inv_icm42600_accel_parse_fifo(struct iio_dev *indio_dev)
 	ssize_t i, size;
 	unsigned int no;
 	const void *accel, *gyro, *timestamp;
-	const int8_t *temp;
+	const s8 *temp;
 	unsigned int odr;
 	int64_t ts_val;
 	/* buffer is copied to userspace, zeroing it to avoid any data leak */
#4 lore raw
Quoted 10 lines · Jonathan Cameron
Quoted 3 lines · On Sun, 9 Nov 2025 20:24:36 +0100 Andy Shevchenko…

The driver code is full of intXX_t and uintXX_t types which is not the pattern we use in the IIO subsystem. Switch the driver to use kernel internal types for that. No functional changes.

No problem with the change but this description made me think that this was going to be a huge patch touching lots of instances.

Probably needs a rewrite to not say 'full of' :)

Can you tweak that whilst applying, please?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#5 lore raw
Quoted 7 lines · On Tue, 3 Feb 2026 13:21:13 +0200 Andy Shevchenko…
Quoted 6 lines · Jonathan Cameron
Quoted 3 lines · On Sun, 9 Nov 2025 20:24:36 +0100 Andy Shevchenko…

The driver code is full of intXX_t and uintXX_t types which is not the pattern we use in the IIO subsystem. Switch the driver to use kernel internal types for that. No functional changes.

Quoted 7 lines
Quoted 4 lines

No problem with the change but this description made me think that this was going to be a huge patch touching lots of instances.

Probably needs a rewrite to not say 'full of' :)

Can you tweak that whilst applying, please?

Ah. I'd accidentally marked this in patch work as handled and forgotten about it.

Anyhow picked it up now with a tweak to the description.

Note I'll only be pushing that tree at as testing until rc1.