rp/pio: remove a bunch of unnecessary let _ = self

This commit is contained in:
pennae 2023-04-25 20:18:22 +02:00
parent 58e727d3b9
commit fa1ec29ae6

View File

@ -328,7 +328,6 @@ impl<PIO: PioInstance, SM: SmInstance> PioStateMachine for PioStateMachineInstan
pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin { pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
fn pio_no(&self) -> u8 { fn pio_no(&self) -> u8 {
let _ = self;
Self::Pio::PIO_NO Self::Pio::PIO_NO
} }
@ -337,7 +336,6 @@ pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
} }
fn restart(&mut self) { fn restart(&mut self) {
let _ = self;
unsafe { unsafe {
Self::Pio::PIO Self::Pio::PIO
.ctrl() .ctrl()
@ -345,7 +343,6 @@ pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
} }
} }
fn set_enable(&mut self, enable: bool) { fn set_enable(&mut self, enable: bool) {
let _ = self;
let mask = 1u8 << Self::Sm::SM_NO; let mask = 1u8 << Self::Sm::SM_NO;
unsafe { unsafe {
Self::Pio::PIO Self::Pio::PIO
@ -355,25 +352,20 @@ pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
} }
fn is_enabled(&self) -> bool { fn is_enabled(&self) -> bool {
let _ = self;
unsafe { Self::Pio::PIO.ctrl().read().sm_enable() & (1u8 << Self::Sm::SM_NO) != 0 } unsafe { Self::Pio::PIO.ctrl().read().sm_enable() & (1u8 << Self::Sm::SM_NO) != 0 }
} }
fn is_tx_empty(&self) -> bool { fn is_tx_empty(&self) -> bool {
let _ = self;
unsafe { Self::Pio::PIO.fstat().read().txempty() & (1u8 << Self::Sm::SM_NO) != 0 } unsafe { Self::Pio::PIO.fstat().read().txempty() & (1u8 << Self::Sm::SM_NO) != 0 }
} }
fn is_tx_full(&self) -> bool { fn is_tx_full(&self) -> bool {
let _ = self;
unsafe { Self::Pio::PIO.fstat().read().txfull() & (1u8 << Self::Sm::SM_NO) != 0 } unsafe { Self::Pio::PIO.fstat().read().txfull() & (1u8 << Self::Sm::SM_NO) != 0 }
} }
fn is_rx_empty(&self) -> bool { fn is_rx_empty(&self) -> bool {
let _ = self;
unsafe { Self::Pio::PIO.fstat().read().rxempty() & (1u8 << Self::Sm::SM_NO) != 0 } unsafe { Self::Pio::PIO.fstat().read().rxempty() & (1u8 << Self::Sm::SM_NO) != 0 }
} }
fn is_rx_full(&self) -> bool { fn is_rx_full(&self) -> bool {
let _ = self;
unsafe { Self::Pio::PIO.fstat().read().rxfull() & (1u8 << Self::Sm::SM_NO) != 0 } unsafe { Self::Pio::PIO.fstat().read().rxfull() & (1u8 << Self::Sm::SM_NO) != 0 }
} }
@ -430,7 +422,6 @@ pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
} }
fn clkdiv_restart(&mut self) { fn clkdiv_restart(&mut self) {
let _ = self;
unsafe { unsafe {
Self::Pio::PIO Self::Pio::PIO
.ctrl() .ctrl()
@ -785,7 +776,6 @@ pub trait PioStateMachine: sealed::PioStateMachine + Sized + Unpin {
where where
I: Iterator<Item = u16>, I: Iterator<Item = u16>,
{ {
let _ = self;
write_instr( write_instr(
Self::Pio::PIO, Self::Pio::PIO,
Self::Pio::PIO_NO, Self::Pio::PIO_NO,
@ -953,7 +943,6 @@ pub trait PioCommon: sealed::PioCommon + Sized {
where where
I: Iterator<Item = u16>, I: Iterator<Item = u16>,
{ {
let _ = self;
write_instr(Self::Pio::PIO, Self::Pio::PIO_NO, start, instrs, MEM_USED_BY_COMMON); write_instr(Self::Pio::PIO, Self::Pio::PIO_NO, start, instrs, MEM_USED_BY_COMMON);
} }
@ -1024,7 +1013,6 @@ impl<const SM_NO: u8> SmInstance for SmInstanceBase<SM_NO> {}
pub trait PioPeripheral: sealed::PioPeripheral + Sized { pub trait PioPeripheral: sealed::PioPeripheral + Sized {
fn pio(&self) -> u8 { fn pio(&self) -> u8 {
let _ = self;
Self::Pio::PIO_NO Self::Pio::PIO_NO
} }
@ -1037,7 +1025,6 @@ pub trait PioPeripheral: sealed::PioPeripheral + Sized {
PioStateMachineInstance<Self::Pio, SmInstanceBase<2>>, PioStateMachineInstance<Self::Pio, SmInstanceBase<2>>,
PioStateMachineInstance<Self::Pio, SmInstanceBase<3>>, PioStateMachineInstance<Self::Pio, SmInstanceBase<3>>,
) { ) {
let _ = self;
( (
PioCommonInstance { PioCommonInstance {
pio: PhantomData::default(), pio: PhantomData::default(),