Re: [PATCH v4 1/2] iio: imu: inv_icm42600: add WoM support
From: Jean-Baptiste Maneyrol
Date: Fri Jun 13 2025 - 08:47:33 EST
>
>________________________________________
>From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>Sent: Friday, June 13, 2025 10:29
>To: Jean-Baptiste Maneyrol <Jean-Baptiste.Maneyrol@xxxxxxx>
>Cc: Jonathan Cameron <jic23@xxxxxxxxxx>; Lars-Peter Clausen <lars@xxxxxxxxxx>; David Lechner <dlechner@xxxxxxxxxxxx>; Nuno Sá <nuno.sa@xxxxxxxxxx>; Andy Shevchenko <andy@xxxxxxxxxx>; linux-iio@xxxxxxxxxxxxxxx <linux-iio@xxxxxxxxxxxxxxx>; linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>
>Subject: Re: [PATCH v4 1/2] iio: imu: inv_icm42600: add WoM support
>
>This Message Is From an External Sender
>This message came from outside your organization.
>
>On Fri, Jun 13, 2025 at 09:34:26AM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:
>>
>> Add WoM as accel roc rising x|y|z event.
>
>...
>
>> + if (sleep_ms)
>> + msleep(sleep_ms);
>
>I still wonder if we can get rid of the conditional here.
>Would the
>
> fsleep(sleep_ms * USEC_PER_MSEC)
>
>actually work as expected?
>
>Ditto for other case(s) like this.
fsleep(0) would call udelay(0) which is architecture dependent. It seems like
it may delay for a very little while, but I'm not able to check that.
>
>...
>
>Overall, looking to this patch again, I think it would be better to prepend it
>by replacing *int*_t types by the respective uXX ones. Because in this patch
>we add dozens of new ones which increases an unneeded churn in the future.
>
In my opinion, to respect the rule don't mix *int*_t and uXX types, it is better
to keep *int*_t types. If it need to be changed, we can change afterward the
whole driver types with a replace tool and send it in a separate patch.
Jonathan,
what is your statement on this point?
>--
>With Best Regards,
>Andy Shevchenko
>
Thanks,
JB