[PATCH v4 4/4] boot: Move preparing bootdev into a function

Tom Rini trini at konsulko.com
Sat Oct 11 18:45:53 CEST 2025


On Sat, Oct 11, 2025 at 08:20:02AM +0100, Simon Glass wrote:
> Hi Tom,
> 
> On Fri, 10 Oct 2025 at 15:38, Tom Rini <trini at konsulko.com> wrote:
> >
> > On Fri, Oct 10, 2025 at 11:36:20AM +0100, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Thu, 9 Oct 2025 at 18:35, Tom Rini <trini at konsulko.com> wrote:
> > > >
> > > > On Thu, Oct 09, 2025 at 03:29:55AM -0600, Simon Glass wrote:
> > > >
> > > > > The code at the end of iter_inc() is already somewhat tortuous. Before
> > > > > making it worse, move it into a function.
> > > >
> > > > This is not a great commit message. Taking a look at v2 as a whole, the
> > > > reason to extract this logic from the end of iter_inc is because you
> > > > will be checking it in multiple places. That is a good reason to move
> > > > the code. Adding another 5 lines of code (a single if test) alone would
> > > > not be.
> > >
> > > OK, so how about:
> > >
> > > The code at the end of iter_inc() is already somewhat tortuous. A future
> > > series needs to call it in from two places in iter_inc(), so move it
> > > into a function.
> >
> > No, I dropped the "already somewhat tortuous" part on purpose, because
> > it's just normal regular easy to understand code. It's on that threshold
> > of indentation where you could break it out, or you could leave it, and
> > be fine. The entire reason to split it out is because it will be called
> > in multiple places.
> 
> OK, so how about:
> 
> We will want to use this same logic in another place within
> iter_inc(), so split it out into its own function.

Yes, that's tone-neutral and so is fine, thanks.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251011/a874ba25/attachment.sig>


More information about the U-Boot mailing list