Re: [PATCH v3 2/2] iio: proximity: cleanup fixes for vl53l1x-i2c

From: Jonathan Cameron

Date: Fri Jun 12 2026 - 13:44:54 EST


On Thu, 11 Jun 2026 22:23:30 +0300
Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

> On Thu, Jun 11, 2026 at 07:42:30PM +0600, Siratul Islam wrote:
> > Extract data-ready polling into a helper, fix regmap_read_poll_timeout()
> > argument alignment, and add field definitions for BIT(0).
> > No functional changes.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>
> ...
>
> > +static int vl53l1x_wait_data_ready(struct vl53l1x_data *data)
> > +{
> > + unsigned int val;
> > +
> > + /* 1ms poll, 1s timeout covers max timing budgets (per ST Ultra Lite Driver) */
> > + return regmap_read_poll_timeout(data->regmap,
> > + VL53L1X_REG_GPIO__TIO_HV_STATUS,
> > + val, (val & VL53L1X_GPIO__TIO_HV_STATUS_DATA_READY) !=
> > + data->gpio_polarity,
>
> I would put it this way
> val,
> (val & VL53L1X_GPIO__TIO_HV_STATUS_DATA_READY) != data->gpio_polarity,
>
> but it goes over even 100! So up to Jonathan.
It's ugly whatever we do but 100 is too fa. This may be a case for just not aligning with the bracket.

return regmap_read_poll_timeout(data->regmap,
VL53L1X_REG_GPIO__TIO_HV_STATUS, val,
(val & VL53L1X_GPIO__TIO_HV_STATUS_DATA_READY) != data->gpio_polarity,
1 * USEC_PER_MSEC, 1 * USEC_PER_SEC);


or at least avoiding the mix of a full parameter and half of next one lin line.
return regmap_read_poll_timeout(data->regmap,
VL53L1X_REG_GPIO__TIO_HV_STATUS,
val,
(val & VL53L1X_GPIO__TIO_HV_STATUS_DATA_READY) !=
data->gpio_polarity,
1 * USEC_PER_MSEC, 1 * USEC_PER_SEC);

I think I'd go with the first option of just not aligning after the bracket.
}
>