From: Gary Guo Date: Tue, 2 Jun 2026 14:17:56 +0000 (+0100) Subject: gpu: nova-core: convert to keyworded projection syntax X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=738a9213755ee13e0523192dfcc7c4f1d2b3f28c;p=thirdparty%2Fkernel%2Flinux.git gpu: nova-core: convert to keyworded projection syntax Use "build" to denote that the index bounds checking here is performed at build time. Reviewed-by: Alexandre Courbot Reviewed-by: Alice Ryhl Signed-off-by: Gary Guo Acked-by: Danilo Krummrich Link: https://patch.msgid.link/20260602-projection-syntax-rework-v2-5-6989470f5440@garyguo.net Signed-off-by: Miguel Ojeda --- diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/cmdq.rs index 275da9b1ee0e9..1c9b2085f5e4f 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -237,7 +237,7 @@ impl DmaGspMem { let start = gsp_mem.dma_handle(); // Write values one by one to avoid an on-stack instance of `PteArray`. for i in 0..GspMem::PTE_ARRAY_SIZE { - dma_write!(gsp_mem, .ptes.0[i], PteArray::<0>::entry(start, i)?); + dma_write!(gsp_mem, .ptes.0[build: i], PteArray::<0>::entry(start, i)?); } dma_write!( @@ -260,7 +260,7 @@ impl DmaGspMem { let rx = self.gsp_read_ptr(); // Pointer to the first entry of the CPU message queue. - let data = ptr::project!(mut self.0.as_mut_ptr(), .cpuq.msgq.data[0]); + let data = ptr::project!(mut self.0.as_mut_ptr(), .cpuq.msgq.data[build: 0]); let (tail_end, wrap_end) = if rx == 0 { // The write area is non-wrapping, and stops at the second-to-last entry of the command @@ -322,7 +322,7 @@ impl DmaGspMem { let rx = self.cpu_read_ptr(); // Pointer to the first entry of the GSP message queue. - let data = ptr::project!(self.0.as_ptr(), .gspq.msgq.data[0]); + let data = ptr::project!(self.0.as_ptr(), .gspq.msgq.data[build: 0]); let (tail_end, wrap_end) = if rx <= tx { // Read area is non-wrapping and stops right before `tx`.