Re: [PATCH v2 08/12] gpu: nova-core: falcon: rename the local variables of dma_wr()

From: Eliot Courtney

Date: Mon Nov 09 2026 - 00:41:04 EST


On Sat Nov 7, 2026 at 6:48 PM JST, Alexandre Courbot wrote:
> The local variables of dma_wr() are named after a generic DMA address,
> while what they hold are the values programmed into specific registers.
> Worse, the `src_start` local has the same name as the `src_start` field
> of `FalconDmaLoadTarget`, but a different value for DMEM transfers.
>
> Rename them after the registers they end up in:
>
> - `dma_address` -> `dma_base`, programmed into DMATRFBASE,
> - `src_start` -> `fb_offset`, programmed into DMATRFFBOFFS,
> - `dma_start` -> `base_offset`, the part of the source offset that is
> folded into the DMA base.
>
> No functional change.
>
> Signed-off-by: Alexandre Courbot <acourbot@xxxxxxxxxx>
> ---
> drivers/gpu/nova-core/falcon.rs | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/falcon.rs b/drivers/gpu/nova-core/falcon.rs
> index ad497a5704ec..3b3e8e0f821a 100644
> --- a/drivers/gpu/nova-core/falcon.rs
> +++ b/drivers/gpu/nova-core/falcon.rs
> @@ -562,13 +562,13 @@ fn dma_wr(
> // For IMEM, we want to use the start offset as a virtual address tag for each page, since
> // code addresses in the firmware (and the boot vector) are virtual.
> //
> - // For DMEM, the start offset is folded into the DMA address.
> - let (src_start, dma_start) = match target_mem {
> + // For DMEM, the start offset is folded into the DMA base.
> + let (fb_offset, base_offset) = match target_mem {
> FalconMem::ImemSecure | FalconMem::ImemNonSecure => (load_offsets.src_start, 0),
> FalconMem::Dmem => (0, usize::from_safe_cast(load_offsets.src_start)),
> };
>
> - let dma_address = {
> + let dma_base = {
> // Upper limit of transfer is `(num_transfers * DMA_LEN) + load_offsets.src_start`.
> let dma_end = num_transfers

nit: also rename `dma_end`? e.g. `end_offset`

Reviewed-by: Eliot Courtney <ecourtney@xxxxxxxxxx>