Don't use &mut for immutable data
We never modify the VM Base DTBO, and there's no reason we would, so
don't pass around a mutable reference to it.
Bug: 318431695
Test: Still builds
Test: Flash pvmfw, start pVM
Change-Id: Iea3cd40244e9014af96819d0068f389c0923c70c
diff --git a/pvmfw/src/fdt.rs b/pvmfw/src/fdt.rs
index 44e55dd..33a5055 100644
--- a/pvmfw/src/fdt.rs
+++ b/pvmfw/src/fdt.rs
@@ -651,7 +651,7 @@
pub fn sanitize_device_tree(
fdt: &mut [u8],
vm_dtbo: Option<&mut [u8]>,
- vm_base_dtbo: Option<&mut [u8]>,
+ vm_base_dtbo: Option<&[u8]>,
) -> Result<DeviceTreeInfo, RebootReason> {
let fdt = Fdt::from_mut_slice(fdt).map_err(|e| {
error!("Failed to load FDT: {e}");
@@ -696,7 +696,7 @@
}
if let Some(vm_base_dtbo) = vm_base_dtbo {
- let vm_base_dtbo = Fdt::from_mut_slice(vm_base_dtbo).map_err(|e| {
+ let vm_base_dtbo = Fdt::from_slice(vm_base_dtbo).map_err(|e| {
error!("Failed to load VM base DTBO: {e}");
RebootReason::InvalidFdt
})?;