Skip to content

Commit

Permalink
Remove an extra function call in primask::read
Browse files Browse the repository at this point in the history
There doesn't seem to be any reason why the call to `__primask_r` should
be wrapped by another function call.
  • Loading branch information
yvt committed Feb 19, 2021
1 parent 7481f09 commit e802d0e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/register/primask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ impl Primask {
/// Reads the CPU register
#[inline]
pub fn read() -> Primask {
fn read_raw() -> u32 {
call_asm!(__primask_r() -> u32)
}

let r = read_raw();
let r: u32 = call_asm!(__primask_r() -> u32);
if r & (1 << 0) == (1 << 0) {
Primask::Inactive
} else {
Expand Down

0 comments on commit e802d0e

Please sign in to comment.