Skip to content

Commit 4589661

Browse files
committed
Don't assert(level<8), just note that we mask it
1 parent ea7ce5c commit 4589661

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/peripheral/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ impl Cpuid {
137137
///
138138
/// * `level`: the required cache level minus 1, e.g. 0 for L1, 1 for L2
139139
/// * `ind`: select instruction cache or data/unified cache
140+
///
141+
/// `level` is masked to be between 0 and 7.
140142
pub fn select_cache(&self, level: u8, ind: CsselrCacheType) {
141-
assert!(level<8);
142143
unsafe { self.csselr.write(
143144
(((level as u32) << CSSELR_LEVEL_POS) & CSSELR_LEVEL_MASK) |
144145
(((ind as u32) << CSSELR_IND_POS) & CSSELR_IND_MASK)

0 commit comments

Comments
 (0)