[PATCH] sysinfo: gpio: fix loop over DT "revisions" array
trini at konsulko.com
Fri Mar 31 16:16:36 CEST 2023
On Fri, Mar 10, 2023 at 11:58:03AM +0100, Rasmus Villemoes wrote:
> There can certainly be a lot more elements in the "revisions" (and
> "names") arrays than there are gpios used to form the trinary number
> we're searching for; we simply don't know the array size up-front.
> Nor do we need to, because the loop body already knows to recognize
> -EOVERFLOW as "not that many elements present" (and we have a test
> that specifically ensures that dev_read_u32_index() returns exactly
> that). So just drop the i < priv->gpio_num condition.
> While in here, fix the weird placement of the default: keyword.
> Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Sean Anderson <sean.anderson at seco.com>
Applied to u-boot/next, thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 659 bytes
Desc: not available
More information about the U-Boot