Skip to content

Commit e8aee52

Browse files
authored
Remove redundant alignment check (#314)
1 parent 2c9d4ca commit e8aee52

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/structures/paging/frame.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ impl<S: PageSize> PhysFrame<S> {
2424
if !address.is_aligned(S::SIZE) {
2525
return Err(AddressNotAligned);
2626
}
27-
Ok(PhysFrame::containing_address(address))
27+
28+
// SAFETY: correct address alignment is checked above
29+
Ok(unsafe { PhysFrame::from_start_address_unchecked(address) })
2830
}
2931

3032
const_fn! {

0 commit comments

Comments
 (0)