The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Siratul Islam <email@sirat.me>,
	dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/2] iio: proximity: cleanup fixes for vl53l1x-i2c
Date: Fri, 12 Jun 2026 18:44:45 +0100	[thread overview]
Message-ID: <20260612184445.124d0119@jic23-huawei> (raw)
In-Reply-To: <aisLMs0Y5na9G-Qc@ashevche-desk.local>

On Thu, 11 Jun 2026 22:23:30 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> 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@intel.com>
> 
> ...
> 
> > +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.
}  
> 


  reply	other threads:[~2026-06-12 17:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 13:42 [PATCH v3 0/2] iio: proximity: cleanup fixes for vl53l1x-i2c Siratul Islam
2026-06-11 13:42 ` [PATCH v3 1/2] iio: proximity: sort the register values " Siratul Islam
2026-06-11 19:21   ` Andy Shevchenko
2026-06-11 13:42 ` [PATCH v3 2/2] iio: proximity: cleanup fixes " Siratul Islam
2026-06-11 19:23   ` Andy Shevchenko
2026-06-12 17:44     ` Jonathan Cameron [this message]
2026-06-12 17:40   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260612184445.124d0119@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=email@sirat.me \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox