From 4601f4e1ebc94aa50edd224af087168bc996d7af Mon Sep 17 00:00:00 2001 From: xoviat Date: Tue, 13 Jun 2023 21:15:01 -0500 Subject: [PATCH] stm32/wpan: minor linked list cleanpu --- embassy-stm32-wpan/src/unsafe_linked_list.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/embassy-stm32-wpan/src/unsafe_linked_list.rs b/embassy-stm32-wpan/src/unsafe_linked_list.rs index ddec1afb..a312178b 100644 --- a/embassy-stm32-wpan/src/unsafe_linked_list.rs +++ b/embassy-stm32-wpan/src/unsafe_linked_list.rs @@ -203,22 +203,22 @@ impl LinkedListNode { todo!("this function has not been converted to volatile semantics"); } - pub unsafe fn get_next_node(mut p_ref_node: *mut LinkedListNode, mut p_node: *mut *mut LinkedListNode) { + pub unsafe fn get_next_node(mut p_ref_node: *mut LinkedListNode) -> *mut LinkedListNode { interrupt::free(|_| { let ref_node = ptr::read_volatile(p_ref_node); // Allowed because a removed node is not seen by another core - *p_node = ref_node.next; - }); + ref_node.next + }) } - pub unsafe fn get_prev_node(mut p_ref_node: *mut LinkedListNode, mut p_node: *mut *mut LinkedListNode) { + pub unsafe fn get_prev_node(mut p_ref_node: *mut LinkedListNode) -> *mut LinkedListNode { interrupt::free(|_| { let ref_node = ptr::read_volatile(p_ref_node); // Allowed because a removed node is not seen by another core - *p_node = ref_node.prev; - }); + ref_node.prev + }) } }