gpu: nova-core: fsp: use KVec::zeroed() in recv_msg()
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- drivers/gpu/nova-core/falcon/fsp.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/nova-core/falcon/fsp.rs +1 -3
@@ -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.
Quoted 1 line · Thorsten Blum
[PATCH] gpu: nova-core: fsp: use
KVec::zeroed()inrecv_msg()
Applied, thanks!
Branch: drm-rust-next
Tree: https://gitlab.freedesktop.org/drm/rust/kernel.git
[1/1] gpu: nova-core: fsp: use KVec::zeroed() in recv_msg()
commit: 3e3404c52370
[ Avoid the unnecessary turbofish syntax. - Danilo ]
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.