File tree 3 files changed +4
-9
lines changed
3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 25
25
//! * <https://wiki.osdev.org/Global_Descriptor_Table>
26
26
27
27
use core:: alloc:: Layout ;
28
- use core:: mem;
29
28
use core:: ptr:: addr_of;
29
+ use core:: { mem, ptr} ;
30
30
31
31
use alloc:: alloc:: alloc_zeroed;
32
32
@@ -271,7 +271,7 @@ impl GdtEntry {
271
271
272
272
fn set_raw < T > ( & mut self , value : T ) {
273
273
unsafe {
274
- * ( self as * mut _ as * mut T ) = value;
274
+ * ( ptr :: addr_of_mut! ( * self ) . cast :: < T > ( ) ) = value;
275
275
}
276
276
}
277
277
}
Original file line number Diff line number Diff line change 15
15
// You should have received a copy of the GNU General Public License
16
16
// along with Aero. If not, see <https://www.gnu.org/licenses/>.
17
17
18
- use core:: mem:: MaybeUninit ;
19
-
20
18
use alloc:: boxed:: Box ;
21
19
use alloc:: sync:: { Arc , Weak } ;
22
20
@@ -53,10 +51,7 @@ impl GroupDescriptors {
53
51
let bgdt_len = superblock. bgdt_len ( ) ;
54
52
let mut bgdt = Box :: < [ disk:: GroupDescriptor ] > :: new_uninit_slice ( bgdt_len) ;
55
53
56
- device. read (
57
- superblock. bgdt_block ( ) ,
58
- MaybeUninit :: slice_as_bytes_mut ( & mut bgdt) ,
59
- ) ?;
54
+ device. read ( superblock. bgdt_block ( ) , bgdt. as_bytes_mut ( ) ) ?;
60
55
61
56
// SAFETY: We have initialized the BGD (Block Group Descriptor Table) above.
62
57
let bgdt = unsafe { bgdt. assume_init ( ) } ;
Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ impl INodeInterface for INode {
557
557
Ok ( path. into ( ) )
558
558
} else {
559
559
let mut buffer = Box :: < [ u8 ] > :: new_uninit_slice ( path_len) ;
560
- self . read ( 0 , MaybeUninit :: slice_as_bytes_mut ( & mut buffer) ) ?;
560
+ self . read ( 0 , buffer. as_bytes_mut ( ) ) ?;
561
561
562
562
let path_bytes = unsafe { buffer. assume_init ( ) } ;
563
563
let path = core:: str:: from_utf8 ( & path_bytes) . or ( Err ( FileSystemError :: InvalidPath ) ) ?;
You can’t perform that action at this time.
0 commit comments