This removes an unsafe impl of `AsBytes`.

Signed-off-by: Eliot Courtney <[email protected]>
---
 drivers/gpu/nova-core/firmware/gen_bootloader.rs | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/nova-core/firmware/gen_bootloader.rs 
b/drivers/gpu/nova-core/firmware/gen_bootloader.rs
index a598eb451665..7e53f287ca2a 100644
--- a/drivers/gpu/nova-core/firmware/gen_bootloader.rs
+++ b/drivers/gpu/nova-core/firmware/gen_bootloader.rs
@@ -12,9 +12,9 @@
         TryIntoBounded, //
     },
     prelude::*,
-    ptr::Alignable,
-    transmute::AsBytes, //
+    ptr::Alignable, //
 };
+use zerocopy_derive::Immutable;
 
 use crate::{
     falcon::{
@@ -46,7 +46,7 @@
 /// This has to be filled by the GPU driver and copied into DMEM at offset
 /// [`BootloaderDesc.dmem_load_off`].
 #[repr(C, packed)]
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, IntoBytes, Immutable)]
 pub(crate) struct BootloaderDmemDescV2 {
     /// Reserved, should always be first element.
     reserved: [u32; 4],
@@ -123,9 +123,6 @@ pub(super) fn new(desc: &FalconUCodeDescV2, code_dma_base: 
u64, data_dma_base: u
     }
 }
 
-// SAFETY: This struct doesn't contain uninitialized bytes and doesn't have 
interior mutability.
-unsafe impl AsBytes for BootloaderDmemDescV2 {}
-
 /// The generic falcon bootloader image and its IMEM load parameters.
 pub(crate) struct GenericBootloader {
     /// Bootloader code, zero-padded to a whole number of falcon memory blocks.

-- 
2.56.1

Reply via email to