Clean up warnings (#2317)

This commit is contained in:
Dániel Buga 2024-10-09 16:53:32 +02:00 committed by GitHub
parent be9dc0e0b7
commit f93efa73a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -923,8 +923,9 @@ unsafe impl DmaTxBuffer for EmptyBuf {
type View = EmptyBuf;
fn prepare(&mut self) -> Preparation {
#[allow(unused_unsafe)] // stable requires unsafe, nightly complains about it
Preparation {
start: unsafe { EMPTY.as_mut_ptr() },
start: unsafe { core::ptr::addr_of_mut!(EMPTY).cast() },
block_size: None,
}
}
@ -946,8 +947,9 @@ unsafe impl DmaRxBuffer for EmptyBuf {
type View = EmptyBuf;
fn prepare(&mut self) -> Preparation {
#[allow(unused_unsafe)] // stable requires unsafe, nightly complains about it
Preparation {
start: unsafe { EMPTY.as_mut_ptr() },
start: unsafe { core::ptr::addr_of_mut!(EMPTY).cast() },
block_size: None,
}
}

View File

@ -257,8 +257,9 @@ fn stop_current_operation() {
}
fn set_next_rx_buffer() {
#[allow(unused_unsafe)] // stable compiler needs unsafe, nightly complains about it
unsafe {
set_rx_addr(RX_BUFFER.as_mut_ptr());
set_rx_addr(core::ptr::addr_of_mut!(RX_BUFFER).cast());
}
}