Skip to content

Commit 4b7d91a

Browse files
dma: remove unnecessary unsafe
1 parent e33c013 commit 4b7d91a

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

src/dma.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// This should be removed once there are any STM32L0x2 modules making use of
1212
// DMA.
13-
#![cfg_attr(not(feature = "stm32l082"), allow(unused, unused_macros))]
13+
#![cfg_attr(not(feature = "stm32l082"), allow(dead_code, unused_imports))]
1414

1515

1616
use core::{
@@ -341,17 +341,11 @@ macro_rules! impl_channel {
341341
where Word: SupportedWordSize
342342
{
343343
handle.dma.$chfield.cr.write(|w| {
344-
// Safe, as the enum we use should only provide valid
345-
// bit patterns.
346-
let w = unsafe {
347-
w
348-
// Word size in memory
349-
.msize().variant(Word::size())
350-
// Word size in peripheral
351-
.psize().variant(Word::size())
352-
};
353-
354344
w
345+
// Word size in memory
346+
.msize().variant(Word::size())
347+
// Word size in peripheral
348+
.psize().variant(Word::size())
355349
// Memory-to-memory mode disabled
356350
.mem2mem().disabled()
357351
// Priority level

0 commit comments

Comments
 (0)