Re: [PATCH] power: supply: bq256xx: drop always-true inner condition

From: Sebastian Reichel

Date: Mon Jul 20 2026 - 19:16:25 EST



On Fri, 03 Jul 2026 01:15:47 +0530, Anas Khan wrote:
> In bq256xx_array_parse() the inner "if (val < array[i])" repeats the
> second half of the enclosing "if (val > array[i - 1] && val < array[i])",
> so it is always true and the "else return i" arm is dead code. The
> function performs a round-down table lookup, so returning i - 1 for a
> value that falls strictly between two entries is the intended result.
> Collapse the redundant branch into a single "return i - 1;"; no
> functional change.
>
> [...]

Applied, thanks!

[1/1] power: supply: bq256xx: drop always-true inner condition
commit: c41f57bb3b65fe0b2f5f556752dc03ac66b8c5db

Best regards,
--
Sebastian Reichel <sebastian.reichel@xxxxxxxxxxxxx>