Skip to content

Commit 1ef6c56

Browse files
committed
Move mut spec to argument.
The more I think about this, the more I think this is more correct. Considering that the argument is owned, by the function, it seems more correct to just recognize that in the signature. It is not a breaking change since the arg is passed by value since it's a primitive type, so I think this is better. In principle, I would prefer to merge this with the commit that moves the asm code into the crate directly instead of this separate commit.
1 parent dec3cfe commit 1ef6c56

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cortex-m/src/asm.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ pub unsafe fn bx_ns(addr: u32) {
239239
/// This method is used by cortex-m-semihosting to provide semihosting syscalls.
240240
#[inline]
241241
#[cortex_m_macros::asm_wrapper(cortex_m)]
242-
pub unsafe fn semihosting_syscall(nr: u32, arg: u32) -> u32 {
243-
let mut nr = nr;
242+
pub unsafe fn semihosting_syscall(mut nr: u32, arg: u32) -> u32 {
244243
unsafe {
245244
asm!("bkpt #0xab", inout("r0") nr, in("r1") arg, options(nomem, nostack, preserves_flags))
246245
};

0 commit comments

Comments
 (0)