Skip to content

Commit 9274bbf

Browse files
committed
efs: Simplify EfhBhdsIterator.
1 parent 6162d95 commit 9274bbf

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

src/efs.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -916,16 +916,11 @@ impl<
916916
if position != 0xffff_ffff && position != 0
917917
/* sigh. Some images have 0 as "invalid" mark */
918918
{
919-
return match BhdDirectory::load(
919+
return BhdDirectory::load(
920920
self.storage,
921921
position,
922922
self.amd_physical_mode_mmio_size,
923-
) {
924-
Ok(e) => Some(e),
925-
Err(e) => {
926-
None // FIXME: error check
927-
}
928-
};
923+
).ok() // FIXME: error check
929924
}
930925
}
931926
None

src/ondisk.rs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -449,21 +449,20 @@ impl ValueOrLocation {
449449
directory_address_mode,
450450
AddressMode::PhysicalAddress
451451
) {
452-
/* AMD retrofitted (introduced) two
453-
flag bits at the top bits in Milan.
454-
455-
In Rome, you actually COULD use
456-
all the bits.
457-
458-
Newer platform do not regularily use
459-
AddressMode::PhysicalAddress anyway.
460-
461-
But if someone uses
462-
AddressMode::PhysicalAddress,
463-
they might do it on Rome and use
464-
those two top bits as part of the
465-
address.
466-
*/
452+
// AMD retrofitted (introduced) two
453+
// flag bits at the top bits in Milan.
454+
//
455+
// In Rome, you actually COULD use
456+
// all the bits.
457+
//
458+
// Newer platform do not regularily use
459+
// AddressMode::PhysicalAddress anyway.
460+
//
461+
// But if someone uses
462+
// AddressMode::PhysicalAddress,
463+
// they might do it on Rome and use
464+
// those two top bits as part of the
465+
// address.
467466
let v = u64::from(*x);
468467
Ok(v)
469468
} else {

0 commit comments

Comments
 (0)