File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change 2525//! * <https://wiki.osdev.org/Global_Descriptor_Table>
2626
2727use core:: alloc:: Layout ;
28- use core:: mem;
2928use core:: ptr:: addr_of;
29+ use core:: { mem, ptr} ;
3030
3131use alloc:: alloc:: alloc_zeroed;
3232
@@ -271,7 +271,7 @@ impl GdtEntry {
271271
272272 fn set_raw < T > ( & mut self , value : T ) {
273273 unsafe {
274- * ( self as * mut _ as * mut T ) = value;
274+ * ( ptr :: addr_of_mut! ( * self ) . cast :: < T > ( ) ) = value;
275275 }
276276 }
277277}
Original file line number Diff line number Diff line change 1515// You should have received a copy of the GNU General Public License
1616// along with Aero. If not, see <https://www.gnu.org/licenses/>.
1717
18- use core:: mem:: MaybeUninit ;
19-
2018use alloc:: boxed:: Box ;
2119use alloc:: sync:: { Arc , Weak } ;
2220
@@ -53,10 +51,7 @@ impl GroupDescriptors {
5351 let bgdt_len = superblock. bgdt_len ( ) ;
5452 let mut bgdt = Box :: < [ disk:: GroupDescriptor ] > :: new_uninit_slice ( bgdt_len) ;
5553
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 ( ) ) ?;
6055
6156 // SAFETY: We have initialized the BGD (Block Group Descriptor Table) above.
6257 let bgdt = unsafe { bgdt. assume_init ( ) } ;
Original file line number Diff line number Diff line change @@ -557,7 +557,7 @@ impl INodeInterface for INode {
557557 Ok ( path. into ( ) )
558558 } else {
559559 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 ( ) ) ?;
561561
562562 let path_bytes = unsafe { buffer. assume_init ( ) } ;
563563 let path = core:: str:: from_utf8 ( & path_bytes) . or ( Err ( FileSystemError :: InvalidPath ) ) ?;
You can’t perform that action at this time.
0 commit comments