diff options
-rw-r--r-- | src/peripheral/scb.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/peripheral/scb.rs b/src/peripheral/scb.rs index d2aacd7..949f890 100644 --- a/src/peripheral/scb.rs +++ b/src/peripheral/scb.rs @@ -950,8 +950,7 @@ impl SCB { { // NOTE(unsafe) atomic read with no side effects - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [4,15] by SystemHandler design. let priority_ref = unsafe {(*Self::ptr()).shpr.get_unchecked(usize::from(index - 4))}; priority_ref.read() @@ -961,8 +960,7 @@ impl SCB { { // NOTE(unsafe) atomic read with no side effects - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [11,15] by SystemHandler design. let priority_ref = unsafe {(*Self::ptr()).shpr.get_unchecked(usize::from((index - 8) / 4))}; let shpr = priority_ref.read(); @@ -989,8 +987,7 @@ impl SCB { #[cfg(not(armv6m))] { - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [4,15] by SystemHandler design. let priority_ref = (*Self::ptr()).shpr.get_unchecked(usize::from(index - 4)); priority_ref.write(prio) @@ -998,8 +995,7 @@ impl SCB { #[cfg(armv6m)] { - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [11,15] by SystemHandler design. let priority_ref = (*Self::ptr()).shpr.get_unchecked(usize::from((index - 8) / 4)); priority_ref.modify(|value| { |