Re: [PATCH v3 2/7] gpu: nova-core: add TLV parser for firmware files

Timur Tabi <[email protected]>
Newsgroups dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Mon, 2026-07-06 at 15:31 +0900, Alexandre Courbot wrote:
> > I forgot to update get_bytes() to return an error if the value is empty.  That should
> > address a lot
> > of potential issues, including the ones that Sashiko raised.
> 
> The spec says that
> 
>   Lengths of zero are allowed and indicate that the tag is a boolean.
> 
> though, so we probably don't want to return an error in that case.

Just don't call get_bytes() if you expect it to have no value.  I can add a get_bool() or
is_true() function to handle booleans, but there are no users.

Returning error on length==0 simplifies a lot of code on the caller side.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.