pvmfw: Make template Fdt const
Make Fdt::unchecked_from_slice() const so that the template &Fdt can
also be const, making it slightly clearer in the code using it that the
template DT is immutable.
Test: m pvmfw_bin
Bug: 377276983
Change-Id: Ic667d52bf9fb72bea611b0af1749693dae07600a
diff --git a/libs/libfdt/src/lib.rs b/libs/libfdt/src/lib.rs
index 8ea9cd9..5883567 100644
--- a/libs/libfdt/src/lib.rs
+++ b/libs/libfdt/src/lib.rs
@@ -624,7 +624,7 @@
/// # Safety
///
/// It is undefined to call this function on a slice that does not contain a valid device tree.
- pub unsafe fn unchecked_from_slice(fdt: &[u8]) -> &Self {
+ pub const unsafe fn unchecked_from_slice(fdt: &[u8]) -> &Self {
let self_ptr = fdt as *const _ as *const _;
// SAFETY: The pointer is non-null, dereferenceable, and points to allocated memory.
unsafe { &*self_ptr }