Re: [PATCH v3 5/7] gpu: nova-core: transition gen_bootloader to TLV images

"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 Thu Jul 9, 2026 at 7:26 AM JST, Timur Tabi wrote:
> On Mon, 2026-07-06 at 15:31 +0900, Alexandre Courbot wrote:
>> > +        dev_info!(
>> > +            dev,
>> > +            "loaded generic bootloader firmware v{}\n",
>> > +            tlv.get_string(b"VERS")?
>> > +        );
>> 
>> s/dev_info/dev_dbg.
>> 
>> Also, since `dev_dbg` can be compiled out, the check performed on the
>> `VERS` tag existing is not guaranteed to be performed. We should
>> probably extract it out of the `dev_dbg` statement. This is true across
>> the series; which makes me think it might also benefit from a helper to
>> factor out the request_t.v/Tlv::new/dev_dbg common sequence.
>
> We don't care about the VERS tag if we're not going to print it out, so we probably should not
> extract it otherwise.

The spec mentions that this tag is present in all TLV files, so its
absence means the file is invalid and should trigger an error.

>
> I know it's a common pattern, but I couldn't find a way to cleanly combine request_tlv() with
> Tlv::new().

Ah right, `Tlv` keeps a reference to the `Firmware` instance, which
would become a local variable if we used a helper. We could work around
this by using more generics, but that cascades into other ownership
issues and is more trouble than is worth for now.
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.