Skip to content

Commit 738a921

Browse files
nbdd0121ojeda
authored andcommitted
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 <acourbot@nvidia.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Gary Guo <gary@garyguo.net> Acked-by: Danilo Krummrich <dakr@kernel.org> Link: https://patch.msgid.link/20260602-projection-syntax-rework-v2-5-6989470f5440@garyguo.net Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent bd8e808 commit 738a921

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/gpu/nova-core/gsp/cmdq.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl DmaGspMem {
237237
let start = gsp_mem.dma_handle();
238238
// Write values one by one to avoid an on-stack instance of `PteArray`.
239239
for i in 0..GspMem::PTE_ARRAY_SIZE {
240-
dma_write!(gsp_mem, .ptes.0[i], PteArray::<0>::entry(start, i)?);
240+
dma_write!(gsp_mem, .ptes.0[build: i], PteArray::<0>::entry(start, i)?);
241241
}
242242

243243
dma_write!(
@@ -260,7 +260,7 @@ impl DmaGspMem {
260260
let rx = self.gsp_read_ptr();
261261

262262
// Pointer to the first entry of the CPU message queue.
263-
let data = ptr::project!(mut self.0.as_mut_ptr(), .cpuq.msgq.data[0]);
263+
let data = ptr::project!(mut self.0.as_mut_ptr(), .cpuq.msgq.data[build: 0]);
264264

265265
let (tail_end, wrap_end) = if rx == 0 {
266266
// The write area is non-wrapping, and stops at the second-to-last entry of the command
@@ -322,7 +322,7 @@ impl DmaGspMem {
322322
let rx = self.cpu_read_ptr();
323323

324324
// Pointer to the first entry of the GSP message queue.
325-
let data = ptr::project!(self.0.as_ptr(), .gspq.msgq.data[0]);
325+
let data = ptr::project!(self.0.as_ptr(), .gspq.msgq.data[build: 0]);
326326

327327
let (tail_end, wrap_end) = if rx <= tx {
328328
// Read area is non-wrapping and stops right before `tx`.

0 commit comments

Comments
 (0)