File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -287,14 +287,17 @@ where
287287 /// Finds and returns the DSDT AML table, if it exists.
288288 pub fn dsdt ( & self ) -> AcpiResult < AmlTable > {
289289 self . find_table :: < fadt:: Fadt > ( ) . and_then ( |fadt| {
290- struct Dsdt ;
290+ #[ repr( transparent) ]
291+ struct Dsdt {
292+ header : SdtHeader ,
293+ }
294+
291295 // Safety: Implementation properly represents a valid DSDT.
292296 unsafe impl AcpiTable for Dsdt {
293297 const SIGNATURE : Signature = Signature :: DSDT ;
294298
295- fn header ( & self ) -> & sdt:: SdtHeader {
296- // Safety: DSDT will always be valid for an SdtHeader at its `self` pointer.
297- unsafe { & * ( self as * const Self as * const sdt:: SdtHeader ) }
299+ fn header ( & self ) -> & SdtHeader {
300+ & self . header
298301 }
299302 }
300303
You can’t perform that action at this time.
0 commit comments