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

"Alexandre Courbot" <[email protected]>
Newsgroups dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
On Fri Jul 3, 2026 at 4:45 AM JST, Timur Tabi wrote:
> On Thu, 2026-07-02 at 14:27 -0500, Timur Tabi wrote:
>> +    pub(crate) fn get_bytes(&self, tag: &[u8; 4]) -> Result<&'a [u8]> {
>> +        let tlv = self.find(tag)?;
>> +
>> +        Ok(tlv.value)
>> +    }
>
> 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.
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.