Re: [PATCH v4 2/2] gpu: nova-core: use SizeConstants trait for u64 size constants

From: Joel Fernandes

Date: Thu Apr 02 2026 - 11:06:31 EST




On 4/2/2026 10:59 AM, Joel Fernandes wrote:
>
>
> On 4/2/2026 10:55 AM, Alexandre Courbot wrote:
>> On Thu Apr 2, 2026 at 11:33 PM JST, Joel Fernandes wrote:
>>>
>>>
>>> On 4/1/2026 6:27 PM, John Hubbard wrote:
>>>> Replace manual usize-to-u64 conversions of SZ_* constants with the
>>>> SizeConstants trait's associated constants on u64. With the
>>>> SizeConstants trait in scope, u64::SZ_1M replaces usize_as_u64(SZ_1M)
>>>> and similar.
>>>>
>>>> This removes several now-unused imports: usize_as_u64, FromSafeCast,
>>>> and individual SZ_* type-level constants.
>>>>
>>>> Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>
>>>> Signed-off-by: John Hubbard <jhubbard@xxxxxxxxxx>
>>>
>>> Reviewed-by: Joel Fernandes <joelagnelf@xxxxxxxxxx>
>>>
>>> I am very happy to see this series since I have these issues with mm
>>> patches quite a bit, which this series will resolve. Should I update the
>>> nova mm series to use these, or wait for it to be merged? The issue with
>>> updating the nova mm series is, then I'll have to either:
>>>
>>> a) carry the series as a dependency.
>>> b) wait for it to merge into drm-rust-next and rebase
>>>
>>> I could do a) and add a [REFERENCE] prefix to the patches, similar to how I
>>> did for some drm buddy bindings patches. Thoughts?
>>
>> There is no need to carry the series into yours, just add a link to the
>> cover letter to your dependencies and folks can pick them up.
>>
>> b4 also provides a dependency management mechanism, and will even fetch
>> them automatically if the people applying your series also use it.
>
> Oooh, b4 can actually track dependencies not in any tree as well? I have to
> check that out.
>

There is also the issue of if we sure we are going forward with this as the
final api (I am inclined to believe it is). Trying to avoid reworking too
much, I'd rather wait in that case for it to be confirmed as being slated
for merge.