Re: [PATCH v6 09/11] iio: adc: hx711: localize loop iterators in hx711_read

From: Andy Shevchenko

Date: Mon May 04 2026 - 11:49:04 EST


On Sun, May 03, 2026 at 05:39:38PM +0530, Piyush Patle wrote:
> Tighten the scope of the loop variables in hx711_read() now that
> trailing-pulse selection is already handled by the callers.
>
> Also replace the 24-bit loop bound with a named constant while touching
> the same code.

...

> /* gain to pulse and scale conversion */

Does the comment stay for the _DATA_BITS? I am not sure it's semantically
correct to put the new definition under the same comment.

> +#define HX711_DATA_BITS 24
> #define HX711_GAIN_MAX 3
> #define HX711_RESET_GAIN 128

--
With Best Regards,
Andy Shevchenko