From e802d0ef23dd10c9d01dda4e04d55f28718ad139 Mon Sep 17 00:00:00 2001 From: yvt Date: Fri, 19 Feb 2021 19:27:26 +0900 Subject: [PATCH] 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. --- src/register/primask.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/register/primask.rs b/src/register/primask.rs index 17f7295f..842ca49a 100644 --- a/src/register/primask.rs +++ b/src/register/primask.rs @@ -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 {