Re: [PATCH FOR REFERENCE v8 10/10] gpu: nova-core: use the kernel `register!` macro
From: John Hubbard
Date: Mon Mar 09 2026 - 14:51:09 EST
On 3/9/26 11:42 AM, Gary Guo wrote:
...
>> The idea was to separate constructing with a zeroed value, from
>> the actual register write. I am not surprised that the syntax
>> is All Wrong at this point, I'm just hoping to spark more ideas
>> about how to make this clear and nice to read.
>
> Separated construct and write is just
>
> let reg = NV_PFALCON_FALCON_MAILBOX1::zeroed().with_value(mbox1);
> bar.write(WithBase::of::<E>(), reg);
>
> (or `bar.write_val(reg)` for non-relative registers)
OK, so I think that Alex's example was sort of a worst case, because
if we wrote it as you do above, it would be clearer to read.
And hopefully we can continue on to what Danilo wrote in the other
thread, which makes it even simpler and clearer.
thanks,
--
John Hubbard