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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXqMRZqezVz8qn_3@smile.fi.intel.com>
Date: Thu, 29 Jan 2026 00:23:01 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: raskar.shree97@...il.com
Cc: Jonathan Cameron <jic23@...nel.org>,
	David Lechner <dlechner@...libre.com>,
	Nuno Sá <nuno.sa@...log.com>,
	Andy Shevchenko <andy@...nel.org>, skhan@...uxfoundation.org,
	david.hunter.linux@...il.com, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v8 3/6] iio: proximity: rfd77402: Use kernel helper for
 result polling

On Wed, Jan 28, 2026 at 11:21:50PM +0530, Shrikant Raskar via B4 Relay wrote:

> Replace the manually written polling loop with read_poll_timeout(),
> the kernel's standard helper for waiting on hardware status.This
> makes the code easier to read.
> 
> Move the polling logic into a dedicated helper function, as it will
> be reused by future updates.

...

> -static int rfd77402_measure(struct i2c_client *client)
> +static int rfd77402_wait_for_result(struct rfd77402_data *data)
>  {
> +	struct i2c_client *client = data->client;
> +	int val, ret;


Where is the newly introduced comment?

> +	ret = read_poll_timeout(i2c_smbus_read_byte_data, val,
> +				 (val < 0) || (val & RFD77402_ICSR_RESULT),
> +				 10 * USEC_PER_MSEC,
> +				 10 * 10 * USEC_PER_MSEC,
> +				 false,
> +				 client, RFD77402_ICSR);
> +	if (val < 0)
> +		return val;
> +
> +	return ret;
> +}

...

> -		/*
> -		 * As per RFD77402 datasheet section '3.1.1 Single Measure',
> -		 * the suggested timeout value for single measure is 100ms.
> -		 */

???

See above.

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ