mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpu: nova-core: gsp: use KVVec::zeroed() for payload buffers
@ 2026-10-06 11:53 Thorsten Blum
  2026-10-06 22:19 ` Danilo Krummrich
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-10-06 11:53 UTC (permalink / raw)
  To: Danilo Krummrich, Alice Ryhl, Alexandre Courbot, David Airlie,
	Simona Vetter, Eliot Courtney, Gary Guo
  Cc: Thorsten Blum, nova-gpu, dri-devel, linux-kernel

Use KVVec::zeroed() instead of KVVec::from_elem() to allocate and
zero-initialize the command and continuation payload buffers.

Also use KVVec::zeroed() in the test helper read_payload().

Signed-off-by: Thorsten Blum <blum@kernel.org>
---
 drivers/gpu/nova-core/gsp/cmdq/continuation.rs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/nova-core/gsp/cmdq/continuation.rs b/drivers/gpu/nova-core/gsp/cmdq/continuation.rs
index 05e904f18097..9ef19f28de97 100644
--- a/drivers/gpu/nova-core/gsp/cmdq/continuation.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq/continuation.rs
@@ -106,9 +106,9 @@ pub(super) fn new(command: C) -> Result<Self> {
 
         if command.size() > MAX_CMD_SIZE {
             let mut command_payload =
-                KVVec::<u8>::from_elem(0u8, payload_len.min(Self::MAX_FIRST_PAYLOAD), GFP_KERNEL)?;
+                KVVec::zeroed(payload_len.min(Self::MAX_FIRST_PAYLOAD), GFP_KERNEL)?;
             let mut continuation_payload =
-                KVVec::<u8>::from_elem(0u8, payload_len - command_payload.len(), GFP_KERNEL)?;
+                KVVec::zeroed(payload_len - command_payload.len(), GFP_KERNEL)?;
             let mut sbuffer = SBufferIter::new_writer([
                 command_payload.as_mut_slice(),
                 continuation_payload.as_mut_slice(),
@@ -235,7 +235,7 @@ fn init_variable_payload(
 
     fn read_payload(cmd: impl CommandToGsp) -> Result<KVVec<u8>> {
         let len = cmd.variable_payload_len();
-        let mut buf = KVVec::from_elem(0u8, len, GFP_KERNEL)?;
+        let mut buf = KVVec::zeroed(len, GFP_KERNEL)?;
         let mut sbuf = SBufferIter::new_writer([buf.as_mut_slice(), &mut []]);
         cmd.init_variable_payload(&mut sbuf)?;
         drop(sbuf);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gpu: nova-core: gsp: use KVVec::zeroed() for payload buffers
  2026-10-06 11:53 [PATCH] gpu: nova-core: gsp: use KVVec::zeroed() for payload buffers Thorsten Blum
@ 2026-10-06 22:19 ` Danilo Krummrich
  0 siblings, 0 replies; 2+ messages in thread
From: Danilo Krummrich @ 2026-10-06 22:19 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Danilo Krummrich, Alice Ryhl, Alexandre Courbot, David Airlie,
	Simona Vetter, Eliot Courtney, Gary Guo, nova-gpu, dri-devel,
	linux-kernel

On Tue,  6 Oct 2026 13:53:06 +0200, Thorsten Blum wrote:
> [PATCH] gpu: nova-core: gsp: use KVVec::zeroed() for payload buffers

Applied, thanks!

  Branch: drm-rust-next
  Tree:   https://gitlab.freedesktop.org/drm/rust/kernel.git

[1/1] gpu: nova-core: gsp: use KVVec::zeroed() for payload buffers
      commit: 6148fb2fc4d3

The patch will appear in the next linux-next integration (typically within 24
hours on weekdays).

The patch is queued up for the upcoming merge window for the next major kernel
release.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-06 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-06 11:53 [PATCH] gpu: nova-core: gsp: use KVVec::zeroed() for payload buffers Thorsten Blum
2026-10-06 22:19 ` Danilo Krummrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®