Skip to content

Commit 416a1db

Browse files
uefi: Simplify MemoryMapBackingMemory
It's not necessary to gate on `cfg(test)`, the system table will not be set in that case so the drop will just do nothing.
1 parent 8d0085c commit 416a1db

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

uefi/src/mem/memory_map/impl_.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ impl MemoryMapBackingMemory {
339339
}
340340

341341
// Don't drop when we use this in unit tests.
342-
#[cfg(not(test))]
343342
impl Drop for MemoryMapBackingMemory {
344343
fn drop(&mut self) {
345344
if let Some(bs) = system_table_boot() {
@@ -348,11 +347,7 @@ impl Drop for MemoryMapBackingMemory {
348347
log::error!("Failed to deallocate memory map: {e:?}");
349348
}
350349
} else {
351-
#[cfg(test)]
352-
log::debug!("Boot services are not available in unit tests.");
353-
354-
#[cfg(not(test))]
355-
log::debug!("Boot services are excited. Memory map won't be freed using the UEFI boot services allocator.");
350+
log::debug!("Boot services are exited. Memory map won't be freed using the UEFI boot services allocator.");
356351
}
357352
}
358353
}

0 commit comments

Comments
 (0)