diff --git a/arch/src/x86_64/smbios.rs b/arch/src/x86_64/smbios.rs index 15de2c7c9..0924e4522 100644 --- a/arch/src/x86_64/smbios.rs +++ b/arch/src/x86_64/smbios.rs @@ -75,8 +75,9 @@ fn compute_checksum(v: &T) -> u8 { (!checksum).wrapping_add(1) } +#[repr(C)] #[repr(packed)] -#[derive(Default, Copy)] +#[derive(Default, Copy, Clone)] pub struct Smbios30Entrypoint { pub signature: [u8; 5usize], pub checksum: u8, @@ -90,14 +91,9 @@ pub struct Smbios30Entrypoint { pub physptr: u64, } -impl Clone for Smbios30Entrypoint { - fn clone(&self) -> Self { - *self - } -} - +#[repr(C)] #[repr(packed)] -#[derive(Default, Copy)] +#[derive(Default, Copy, Clone)] pub struct SmbiosBiosInfo { pub typ: u8, pub length: u8, @@ -112,14 +108,9 @@ pub struct SmbiosBiosInfo { pub characteristics_ext2: u8, } -impl Clone for SmbiosBiosInfo { - fn clone(&self) -> Self { - *self - } -} - +#[repr(C)] #[repr(packed)] -#[derive(Default, Copy)] +#[derive(Default, Copy, Clone)] pub struct SmbiosSysInfo { pub typ: u8, pub length: u8, @@ -134,12 +125,6 @@ pub struct SmbiosSysInfo { pub family: u8, } -impl Clone for SmbiosSysInfo { - fn clone(&self) -> Self { - *self - } -} - // SAFETY: These data structures only contain a series of integers unsafe impl ByteValued for Smbios30Entrypoint {} unsafe impl ByteValued for SmbiosBiosInfo {}