Skip to content

Commit 2f6baef

Browse files
committed
fix: Format, clippy
1 parent 4ab167f commit 2f6baef

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

cortex-m/src/coprocessor.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
pub unsafe fn mcr<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32, const OP2: u32>(
1515
value: u32,
1616
) {
17-
core::arch::asm!(
17+
unsafe { core::arch::asm!(
1818
"MCR p{cp}, #{op1}, {0}, c{crn}, c{crm}, #{op2}",
1919
in(reg) value,
2020
cp = const CP,
@@ -23,7 +23,7 @@ pub unsafe fn mcr<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32,
2323
crm = const CRM,
2424
op2 = const OP2,
2525
options(nostack, nomem)
26-
);
26+
)};
2727
}
2828

2929
/// This instruction moves one Coprocessor Register to a Register.
@@ -37,11 +37,11 @@ pub unsafe fn mcr<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32,
3737
/// - CRM: Coprocessor register M.
3838
/// - OP2: Second optional operation for the coprocessor.
3939
#[inline(always)]
40-
pub unsafe fn mrc<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32, const OP2: u32>(
41-
) -> u32 {
40+
pub unsafe fn mrc<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32, const OP2: u32>()
41+
-> u32 {
4242
let a: u32;
4343

44-
core::arch::asm!(
44+
unsafe { core::arch::asm!(
4545
"MRC p{cp}, #{op1}, {0}, c{crn}, c{crm}, #{op2}",
4646
out(reg) a,
4747
cp = const CP,
@@ -50,7 +50,7 @@ pub unsafe fn mrc<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32,
5050
crm = const CRM,
5151
op2 = const OP2,
5252
options(nostack, nomem)
53-
);
53+
)};
5454

5555
a
5656
}
@@ -65,15 +65,15 @@ pub unsafe fn mrc<const CP: u32, const OP1: u32, const CRN: u32, const CRM: u32,
6565
/// - CRM: Coprocessor register M.
6666
#[inline(always)]
6767
pub unsafe fn mcrr<const CP: u32, const OP1: u32, const CRM: u32>(a: u32, b: u32) {
68-
core::arch::asm!(
68+
unsafe { core::arch::asm!(
6969
"MCRR p{cp}, #{op1}, {0}, {1}, c{crm}",
7070
in(reg) a,
7171
in(reg) b,
7272
cp = const CP,
7373
op1 = const OP1,
7474
crm = const CRM,
7575
options(nostack, nomem)
76-
);
76+
)};
7777
}
7878

7979
/// This instruction moves two Coprocessor Registers to Registers.
@@ -90,15 +90,15 @@ pub unsafe fn mrrc<const CP: u32, const OPC: u32, const CRM: u32>() -> (u32, u32
9090
let a: u32;
9191
let b: u32;
9292

93-
core::arch::asm!(
93+
unsafe { core::arch::asm!(
9494
"MRRC p{cp}, #{opc}, {0}, {1}, c{crm}",
9595
out(reg) a,
9696
out(reg) b,
9797
cp = const CP,
9898
opc = const OPC,
9999
crm = const CRM,
100100
options(nostack, nomem)
101-
);
101+
)};
102102

103103
(a, b)
104104
}

0 commit comments

Comments
 (0)