Browse Source

Remove redundant unsafe blocks

This is the first part of fixing all this code - Rust has realised that
accessing packed fields like this creates unaligned references, which is
not unsafe, but unsound. A future commit will fix these unsound accesses.
Isaac Woods 3 years ago
parent
commit
410d6c8bab
1 changed files with 2 additions and 2 deletions
  1. 2 2
      acpi/src/madt.rs

+ 2 - 2
acpi/src/madt.rs

@@ -129,7 +129,7 @@ impl Madt {
                      * the BSP yet, this must be it.
                      */
                     let is_ap = boot_processor.is_some();
-                    let is_disabled = !unsafe { entry.flags.get_bit(0) };
+                    let is_disabled = !entry.flags.get_bit(0);
 
                     let state = match (is_ap, is_disabled) {
                         (_, true) => ProcessorState::Disabled,
@@ -229,7 +229,7 @@ impl Madt {
     }
 
     pub fn supports_8259(&self) -> bool {
-        unsafe { self.flags.get_bit(0) }
+        self.flags.get_bit(0)
     }
 }