Skip to content

Commit 9bb3b58

Browse files
committed
Refactoring: use set_bits() in set_fs function
1 parent 5ef90e3 commit 9bb3b58

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/register/mstatus.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ pub unsafe fn set_mpp(mpp: MPP) {
183183
#[inline]
184184
pub unsafe fn set_fs(fs: FS) {
185185
let mut value = _read();
186-
value &= !(0b11 << 13);
187-
value |= (fs as usize) << 13;
186+
value.set_bits(13..15, fs as usize);
188187
_write(value);
189188
}

0 commit comments

Comments
 (0)