[PATCH] iio: magnetometer: hid-sensor-magn-3d: prefer 'unsigned int'

Joshua Crofts posted 1 patch 1 month, 4 weeks ago
There is a newer version of this series
drivers/iio/magnetometer/hid-sensor-magn-3d.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[PATCH] iio: magnetometer: hid-sensor-magn-3d: prefer 'unsigned int'
Posted by Joshua Crofts 1 month, 4 weeks ago
Use 'unsigned int' instead of bare 'unsigned' to resolve checkpatch.pl
warnings and adhere to kernel coding style.

No functional change.

Signed-off-by: Joshua Crofts <joshua.crofts1@gmail.com>
---
 drivers/iio/magnetometer/hid-sensor-magn-3d.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index c673f9323e..67550f16a9 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -280,7 +280,7 @@ static const struct iio_info magn_3d_info = {
 
 /* Callback handler to send event after all samples are received and captured */
 static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				unsigned int usage_id,
 				void *priv)
 {
 	struct iio_dev *indio_dev = platform_get_drvdata(priv);
@@ -302,7 +302,7 @@ static int magn_3d_proc_event(struct hid_sensor_hub_device *hsdev,
 
 /* Capture samples in local storage */
 static int magn_3d_capture_sample(struct hid_sensor_hub_device *hsdev,
-				unsigned usage_id,
+				unsigned int usage_id,
 				size_t raw_len, char *raw_data,
 				void *priv)
 {
@@ -350,7 +350,7 @@ static int magn_3d_parse_report(struct platform_device *pdev,
 				struct hid_sensor_hub_device *hsdev,
 				struct iio_chan_spec **channels,
 				int *chan_count,
-				unsigned usage_id,
+				unsigned int usage_id,
 				struct magn_3d_state *st)
 {
 	int i;
-- 
2.47.3
Re: [PATCH] iio: magnetometer: hid-sensor-magn-3d: prefer 'unsigned int'
Posted by Andy Shevchenko 1 month, 4 weeks ago
On Fri, Apr 17, 2026 at 11:28:08AM +0000, Joshua Crofts wrote:
> Use 'unsigned int' instead of bare 'unsigned' to resolve checkpatch.pl
> warnings and adhere to kernel coding style.
> 
> No functional change.

Please, use the same types as defined in the respective data structure.
https://elixir.bootlin.com/linux/v7.0/source/include/linux/hid-sensor-hub.h#L87

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH] iio: magnetometer: hid-sensor-magn-3d: prefer 'unsigned int'
Posted by Joshua Crofts 1 month, 4 weeks ago
On Fri, 17 Apr 2026 at 13:33, Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
> Please, use the same types as defined in the respective data structure.
> https://elixir.bootlin.com/linux/v7.0/source/include/linux/hid-sensor-hub.h#L87

Fair enough, I'll send a version using u32 tomorrow.

-- 
Kind regards

CJD