Skip to content

Commit

Permalink
use slice::from_ptr_range instead of length calc
Browse files Browse the repository at this point in the history
  • Loading branch information
cagatay-y committed Oct 25, 2023
1 parent 62562c5 commit 65a38b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/arch/x86_64/kernel/acpi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,9 @@ fn search_s5_in_table(table: AcpiTable<'_>) {
// Get the AML code.
// As we do not implement an AML interpreter, we search through the bytecode.
let aml = unsafe {
slice::from_raw_parts(
table.table_start_address() as *const u8,
table.table_end_address() - table.table_start_address(),
slice::from_ptr_range(
ptr::from_exposed_addr(table.table_start_address())
..ptr::from_exposed_addr(table.table_end_address()),
)
};

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![feature(pointer_byte_offsets)]
#![feature(pointer_is_aligned)]
#![feature(ptr_from_ref)]
#![feature(slice_from_ptr_range)]
#![cfg_attr(target_arch = "aarch64", feature(specialization))]
#![feature(strict_provenance)]
#![cfg_attr(target_os = "none", no_std)]
Expand Down

0 comments on commit 65a38b8

Please sign in to comment.