* [PATCH] gpu: nova-core: fsp: use KVec::zeroed() in recv_msg()
@ 2026-10-06 6:54 Thorsten Blum
0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-10-06 6:54 UTC (permalink / raw)
To: Danilo Krummrich, Alice Ryhl, Alexandre Courbot, David Airlie,
Simona Vetter, Eliot Courtney, John Hubbard, Gary Guo,
Tim Kovalenko
Cc: Thorsten Blum, nova-gpu, dri-devel, linux-kernel
Use KVec::zeroed() to create the message buffer in recv_msg() instead of
creating an empty vector and resizing it.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/gpu/nova-core/falcon/fsp.rs | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/gpu/nova-core/falcon/fsp.rs b/drivers/gpu/nova-core/falcon/fsp.rs
index 0437180b8829..4190f4f8e8c9 100644
--- a/drivers/gpu/nova-core/falcon/fsp.rs
+++ b/drivers/gpu/nova-core/falcon/fsp.rs
@@ -172,9 +172,7 @@ pub(crate) fn recv_msg(&mut self) -> Result<KVec<u8>> {
return Err(EMSGSIZE);
}
- let mut buffer = KVec::<u8>::new();
- buffer.resize(msg_size, 0, GFP_KERNEL)?;
-
+ let mut buffer = KVec::<u8>::zeroed(msg_size, GFP_KERNEL)?;
self.read_emem(&mut buffer)?;
// Reset message queue pointers after reading.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-06 6:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-06 6:54 [PATCH] gpu: nova-core: fsp: use KVec::zeroed() in recv_msg() Thorsten Blum
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®