lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHD7zEzvVuwSB9Ke@smile.fi.intel.com>
Date: Fri, 11 Jul 2025 14:55:56 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Remi Buisson <Remi.Buisson@....com>
Cc: Jonathan Cameron <jic23@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-iio@...r.kernel.org" <linux-iio@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 2/8] iio: imu: inv_icm45600: add new inv_icm45600
 driver

On Fri, Jul 11, 2025 at 11:32:48AM +0000, Remi Buisson wrote:
> >From: Andy Shevchenko andriy.shevchenko@...el.com<mailto:andriy.shevchenko@...el.com>
> >Sent: Thursday, July 10, 2025 11:30 AM
> >To: Remi Buisson Remi.Buisson@....com<mailto:Remi.Buisson@....com>
> >On Thu, Jul 10, 2025 at 08:57:57AM +0000, Remi Buisson via B4 Relay wrote:

...

> >> +struct inv_icm45600_sensor_conf {
> >> +       int mode;
> >> +       int fs;
> >> +       int odr;
> >> +       int filter;
> >
> >Any of them can hold negative value?
> 
> Yes, when setting the configuration, a negative value means "keep previous configured value".
> Like in the INV_ICM45600_SENSOR_CONF_INIT macro below.

I see, but can't it be as simple as "big number" with the proper type instead?

#define ..._KEEP_VALUE		U8_MAX // or whatever type

> >> +};

...

> >> +#define INV_ICM45600_SENSOR_CONF_INIT                        {-1, -1, -1, -1}
> >
> >Unused.
> This is used in later patch of the serie.
> I will move this definition to the patch using it.

Yes, unused in this code. You should compile the series incrementally,
so each patch will get a compilation test. This is called compile-time
bisectability. Also run the system each time to confirm no regressions
(this is called run-time bisectability).

...

> >> +                      udelay(INV_ICM45600_IREG_DELAY_US);
> >
> >Can fsleep() be used here?
> I will use fsleep there.
> Is it recommended to use fsleep everywhere else in place of other sleep APIs?

Not everywhere, but in general yes, if in doubt, use it (but the author is
the one who knows their the code and answer to this question).

...

> It's probably safer to keep the delay even in case of failure to make sure
> the device is ready before next operation.

I am not sure about it. Why? This has to be well justified as it's quite
unusual pattern.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ