vmm: replace #[allow(dead_code)] with expect()

On-behalf-of: SAP philipp.schuster@sap.com
Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
This commit is contained in:
Philipp Schuster
2026-06-03 14:37:14 +02:00
committed by Rob Bradford
parent 619f964747
commit 360e155cac
2 changed files with 7 additions and 5 deletions

View File

@@ -150,7 +150,7 @@ const KVM_SNP_PAGE_TYPE_CPUID: u32 = 6;
struct PageTypeConfig {
isolated_page_size_4kb: u32,
normal: u32,
#[allow(dead_code)]
#[cfg_attr(not(feature = "kvm"), expect(dead_code))]
zero: u32,
unmeasured: u32,
cpuid: u32,
@@ -158,11 +158,13 @@ struct PageTypeConfig {
vmsa: u32,
}
#[allow(dead_code)]
#[derive(Copy, Clone)]
struct GpaPages {
pub gpa: u64,
#[cfg_attr(not(feature = "sev_snp"), expect(dead_code))]
pub page_type: u32,
#[cfg_attr(not(feature = "sev_snp"), expect(dead_code))]
pub gpa: u64,
#[allow(dead_code)] // usage pattern too complex, we stick to allow()
pub page_size: u32,
}

View File

@@ -48,9 +48,9 @@ const SEV_HASH_TABLE_PADDING: usize =
#[derive(IntoBytes, Immutable)]
pub struct PaddedSevHashTable {
#[allow(dead_code)]
#[expect(dead_code)]
hash_table: SevHashTable,
#[allow(dead_code)]
#[expect(dead_code)]
padding: [u8; SEV_HASH_TABLE_PADDING],
}