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
287
287
/// Finds and returns the DSDT AML table, if it exists.
288
288
pub fn dsdt ( & self ) -> AcpiResult < AmlTable > {
289
289
self . find_table :: < fadt:: Fadt > ( ) . and_then ( |fadt| {
290
- struct Dsdt ;
290
+ #[ repr( transparent) ]
291
+ struct Dsdt {
292
+ header : SdtHeader ,
293
+ }
294
+
291
295
// Safety: Implementation properly represents a valid DSDT.
292
296
unsafe impl AcpiTable for Dsdt {
293
297
const SIGNATURE : Signature = Signature :: DSDT ;
294
298
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
298
301
}
299
302
}
300
303
You can’t perform that action at this time.
0 commit comments