@@ -344,7 +344,7 @@ impl SCB {
344344 let mut cbp = unsafe { CBP :: new ( ) } ;
345345
346346 // Disable I-cache
347- // NOTE(unsafe): We have synchronised access by &mut self
347+ // NOTE(unsafe): We have synchronized access by &mut self
348348 unsafe { self . ccr . modify ( |r| r & !SCB_CCR_IC_MASK ) } ;
349349
350350 // Invalidate I-cache
@@ -417,7 +417,7 @@ impl SCB {
417417 }
418418
419419 // Turn off the D-cache
420- // NOTE(unsafe): We have synchronised access by &mut self
420+ // NOTE(unsafe): We have synchronized access by &mut self
421421 unsafe { self . ccr . modify ( |r| r & !SCB_CCR_DC_MASK ) } ;
422422
423423 // Clean and invalidate whatever was left in it
@@ -646,10 +646,7 @@ impl SCB {
646646 /// a runtime-dependent `panic!()` call.
647647 #[ inline]
648648 pub unsafe fn invalidate_dcache_by_slice < T > ( & mut self , slice : & mut [ T ] ) {
649- self . invalidate_dcache_by_address (
650- slice. as_ptr ( ) as usize ,
651- slice. len ( ) * core:: mem:: size_of :: < T > ( ) ,
652- ) ;
649+ self . invalidate_dcache_by_address ( slice. as_ptr ( ) as usize , core:: mem:: size_of_val ( slice) ) ;
653650 }
654651
655652 /// Cleans D-cache by address.
@@ -732,10 +729,7 @@ impl SCB {
732729 /// to main memory, overwriting whatever was in main memory.
733730 #[ inline]
734731 pub fn clean_dcache_by_slice < T > ( & mut self , slice : & [ T ] ) {
735- self . clean_dcache_by_address (
736- slice. as_ptr ( ) as usize ,
737- slice. len ( ) * core:: mem:: size_of :: < T > ( ) ,
738- ) ;
732+ self . clean_dcache_by_address ( slice. as_ptr ( ) as usize , core:: mem:: size_of_val ( slice) ) ;
739733 }
740734
741735 /// Cleans and invalidates D-cache by address.
0 commit comments