From 3e3404c52370595e37eb5b942df169884f38a124 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Tue, 6 Oct 2026 08:54:35 +0200 Subject: [PATCH] gpu: nova-core: fsp: use KVec::zeroed() in recv_msg() 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 Link: https://patch.msgid.link/20261006065437.58408-3-blum@kernel.org [ Avoid the unnecessary turbofish syntax. - Danilo ] Signed-off-by: Danilo Krummrich --- 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 85f9c8c5d60e..d7c213848005 100644 --- a/drivers/gpu/nova-core/falcon/fsp.rs +++ b/drivers/gpu/nova-core/falcon/fsp.rs @@ -173,9 +173,7 @@ pub(crate) fn recv_msg(&mut self) -> Result> { return Err(EMSGSIZE); } - let mut buffer = KVec::::new(); - buffer.resize(msg_size, 0, GFP_KERNEL)?; - + let mut buffer = KVec::zeroed(msg_size, GFP_KERNEL)?; self.read_emem(&mut buffer)?; // Reset message queue pointers after reading.