Re: softraid: Correct LBA start offset type

Thomas Habets <[email protected]> Tue, 14 Jul 2026 03:19:50 -0500
Newsgroups gmane.os.openbsd.tech
Message-ID <CA+kHd+dcfdvBZXrJg9iRBDZfpooV1XVC90PZgt86qAVHvBJn_A@mail.gmail.com>
On Mon, 13 Jul 2026 22:39:12 +0100, Jan Klemkow <[email protected]> said:
> On Mon, Jul 13, 2026 at 09:51:12AM -0500, Thomas Habets wrote:
> Thanks for your report.  Btw, your diff was broken and not applicable, because
> you converted all tabs to spaces.  Anyway...

Sorry. I'll avoid losing tabs next time.

> Yes, start have to be big enough to store the return values of
> sr_getdisklabel().  I'm not sure if you (uint64_t)-1 cast is still needed.
> Or, just if (start == -1) could also be sufficient.
>
> But, instead of assigning -1 to an unsigned data type.  We could also use the
> UINT64_MAX constant to indicate the error condition.  At least this looks more
> straight forward to me, thought.

Yeah, sparing the reader needing to even think about integer promotion rules
sounds better.

Your patch looks good to me.