Re: [PATCH 1/4] drm/tyr: name resource lifetimes after their types

From: Gary Guo

Date: Thu Nov 19 2026 - 06:28:51 EST


On Thu Nov 19, 2026 at 10:34 AM GMT, Danilo Krummrich wrote:
> On Thu Nov 19, 2026 at 3:08 AM CET, Gary Guo wrote:
>> On Wed Nov 18, 2026 at 11:37 PM GMT, Danilo Krummrich wrote:
>>> The firmware, buffer, VM and MMU types use 'drm for their resource
>>> lifetimes, even though each parameter is local to its type.
>>
>> This doesn't make any sense, a lifetime on a type by definition cannot refer to
>> a scope of itself.
>>
>> `'sec` is not the lifetime of `Section` and `'fw` is not the lifetime of
>> `Firmware` and I think this is just confusing.
>
> Yes, this was badly phrased. What is actually meant is that e.g. 'fw constrains
> how long a Firmware instance can be used.

I think this is weird still. Any lifetime on a type would constrain how long an
instance of that type can be used, that's just type wellformness.

I think what you're saying is basically "I couldn't think of a good name so I
use the name of the type instead". To me I think using `'a` has the same effect
and is less confusing because reader knows that it is a generic name and is not
tied to any specific scope.

Best,
Gary

>
> (In the following patch, in TyrDrmRegistrationData, Firmware borrows Mmu. That
> borrow has its own lifetime, distinct from TyrDrmRegistrationData's 'drm
> parameter.)