diff options
author | 2021-02-19 19:27:26 +0900 | |
---|---|---|
committer | 2021-02-19 19:27:26 +0900 | |
commit | e802d0ef23dd10c9d01dda4e04d55f28718ad139 (patch) | |
tree | 150a4c9c77289e0c385f3bd84b54661e82262533 | |
parent | 7481f09d67aee7081d71cf6e042f2984c12a830f (diff) | |
download | cortex-m-e802d0ef23dd10c9d01dda4e04d55f28718ad139.tar.gz cortex-m-e802d0ef23dd10c9d01dda4e04d55f28718ad139.tar.zst cortex-m-e802d0ef23dd10c9d01dda4e04d55f28718ad139.zip |
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.
-rw-r--r-- | src/register/primask.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/register/primask.rs b/src/register/primask.rs index 17f7295..842ca49 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 { |