Skip to content

Commit

Permalink
Use core::ptr::addr_of_mut! for all static variables instead of `&m…
Browse files Browse the repository at this point in the history
…ut`.
  • Loading branch information
antoinevg committed Aug 22, 2024
1 parent 5396885 commit 086fc56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/ethernet_hal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ fn main() -> ! {

// create global static ETHERNET object
unsafe {
ETHERNET = Some(Net::new(&mut ETHERNET_STORAGE, eth_dma, mac_addr));
ETHERNET = Some(Net::new(&mut *core::ptr::addr_of_mut!(ETHERNET_STORAGE), eth_dma, mac_addr));
}

// - udp socket -----------------------------------------------------------

let store = unsafe { &mut ETHERNET_STORAGE };
let store = unsafe { &mut *core::ptr::addr_of_mut!(ETHERNET_STORAGE) };
let udp_rx_buffer = UdpSocketBuffer::new(
&mut store.udp_rx_metadata[..],
&mut store.udp_rx_buffer_storage[..],
Expand Down

0 comments on commit 086fc56

Please sign in to comment.