We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc0a309 commit e26262cCopy full SHA for e26262c
1 file changed
drivers/soc/apple/pmp.rs
@@ -20,6 +20,7 @@ use kernel::{
20
dma::CoherentAllocation,
21
io::mem::IoMem,
22
iosys_map::IoSysMapRef,
23
+ kvec,
24
module_platform_driver,
25
new_mutex,
26
of,
@@ -150,10 +151,7 @@ impl PmpData {
150
151
fn patch_bootargs(&self, patches: &[(u32, u32)]) -> Result<()> {
152
let offset = self.pmp_read32(BOOTARGS_OFFSET) as usize;
153
let size = self.pmp_read32(BOOTARGS_SIZE) as usize;
- let mut arg_bytes = KVec::with_capacity(size, GFP_KERNEL)?;
154
- for _ in 0..size {
155
- arg_bytes.push(0, GFP_KERNEL).unwrap();
156
- }
+ let mut arg_bytes = kvec![0u8; size]?;
157
{
158
let pmp_mmio = self.pmp_mmio.try_access().ok_or(ENXIO)?;
159
pmp_mmio.try_memcpy_fromio(&mut arg_bytes, offset)?;
0 commit comments