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

From: Danilo Krummrich

Date: Thu Nov 19 2026 - 08:57:51 EST


On Thu Nov 19, 2026 at 1:56 PM CET, Gary Guo wrote:
> If a rule is to be established, I'd rather it being the following:
>
> - for invariant lifetime parameter, use the name of the borrowed resource
> (because you know the exact lifetime).
>
> - for covariant lifetime parameter (especially if multiple resources are
> borrowed and the lifetime is the shortest among those), pick a generic name
>
> - for covariant lifetime parameter referencing just a single resource, I think
> either is fine -- (as long as it's unlikely to be used by unsafe code that may
> assume that it covers the full lifetime, e.g. 'bound).

I think in the end it comes down to personal preference, so this is fine with me
too.

Though, I'd use a generic name in the latter case too, such that it doesn't need
to be changed once a second resource is referenced later on.