Skip to content

Commit e802d0e

Browse files
authored
Remove an extra function call in primask::read
There doesn't seem to be any reason why the call to `__primask_r` should be wrapped by another function call.
1 parent 7481f09 commit e802d0e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/register/primask.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ impl Primask {
2626
/// Reads the CPU register
2727
#[inline]
2828
pub fn read() -> Primask {
29-
fn read_raw() -> u32 {
30-
call_asm!(__primask_r() -> u32)
31-
}
32-
33-
let r = read_raw();
29+
let r: u32 = call_asm!(__primask_r() -> u32);
3430
if r & (1 << 0) == (1 << 0) {
3531
Primask::Inactive
3632
} else {

0 commit comments

Comments
 (0)