Re: [PATCH v4 4/7] gpu: nova-core: transition gsp to TLV images
"Danilo Krummrich" <[email protected]> Fri, 10 Jul 2026 01:21:40 +0200
| Newsgroups | dev.linux.lists.nova-gpu,dev.linux.lists.driver-core,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Thu Jul 9, 2026 at 11:39 PM CEST, Timur Tabi wrote:
> + let mut fw_vvec = VVec::from_elem(0u8, size, GFP_KERNEL).map_err(|_| ENOMEM)?;
Can you please add a patch introducing Vec::zeroed() instead that uses
__GFP_ZEROED, analogous to Box::zeroed()? I.e. something like this:
pub fn zeroed(n: usize, flags: Flags) -> Result<Self, AllocError>
where
T: Zeroable,
{
let mut v = Self::with_capacity(n, flags | __GFP_ZERO)?;
// SAFETY:
// - `n <= capacity - len`: `with_capacity(n)` guarantees capacity >= n, len is 0.
// - All elements in `[0, n)` are initialized: `__GFP_ZERO` zeroes the allocation,
// and `T: Zeroable` guarantees all-zeroes is a valid bit pattern.
unsafe { v.inc_len(n) };
Ok(v)
}