Skip to content

Commit 33aad22

Browse files
Fix errors and warnings
1 parent f812b5f commit 33aad22

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

src/register/control.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -172,24 +172,22 @@ pub fn read() -> Control {
172172
pub unsafe fn write(_control: Control) {
173173
match () {
174174
#[cfg(cortex_m)]
175-
() => {
176-
let r = match () {
177-
#[cfg(feature = "inline-asm")]
178-
() => {
179-
let control = _control.bits();
180-
unsafe { asm!("msr CONTROL, $0" :: "r"(control) : "memory" : "volatile") }
175+
() => match () {
176+
#[cfg(feature = "inline-asm")]
177+
() => {
178+
let control = _control.bits();
179+
unsafe { asm!("msr CONTROL, $0" :: "r"(control) : "memory" : "volatile") }
180+
}
181+
182+
#[cfg(not(feature = "inline-asm"))]
183+
() => {
184+
extern "C" {
185+
fn __control_w(bits: u32);
181186
}
182187

183-
#[cfg(not(feature = "inline-asm"))]
184-
() => unsafe {
185-
extern "C" {
186-
fn __control_w() -> u32;
187-
}
188-
189-
__control_w(_control.bits())
190-
},
191-
};
192-
}
188+
__control_w(_control.bits());
189+
}
190+
},
193191

194192
#[cfg(not(cortex_m))]
195193
() => unimplemented!(),

0 commit comments

Comments
 (0)