From: Tom Rini <trini@konsulko.com>
To: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Cc: u-boot@lists.denx.de, Sean Anderson <sean.anderson@seco.com>,
Simon Glass <sjg@chromium.org>
Subject: Re: [PATCH] sysinfo: gpio: fix loop over DT "revisions" array
Date: Fri, 31 Mar 2023 10:16:36 -0400 [thread overview]
Message-ID: <20230331141636.GP13222@bill-the-cat> (raw)
In-Reply-To: <20230310105803.1824795-1-rasmus.villemoes@prevas.dk>
[-- Attachment #1: Type: text/plain, Size: 842 bytes --]
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@prevas.dk>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Sean Anderson <sean.anderson@seco.com>
Applied to u-boot/next, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2023-03-31 14:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-10 10:58 [PATCH] sysinfo: gpio: fix loop over DT "revisions" array Rasmus Villemoes
2023-03-10 20:49 ` Simon Glass
2023-03-13 15:23 ` Sean Anderson
2023-03-31 14:16 ` Tom Rini [this message]
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=20230331141636.GP13222@bill-the-cat \
--to=trini@konsulko.com \
--cc=rasmus.villemoes@prevas.dk \
--cc=sean.anderson@seco.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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