aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxoviat <[email protected]>2023-06-13 21:15:01 -0500
committerxoviat <[email protected]>2023-06-13 21:15:01 -0500
commit4601f4e1ebc94aa50edd224af087168bc996d7af (patch)
treeb0e89341d16d2da0e1c74322cdc127d4d0c22cc0
parentae9983324d9ddfa747d7bfc11aecc401c0abfeb9 (diff)
stm32/wpan: minor linked list cleanpu
-rw-r--r--embassy-stm32-wpan/src/unsafe_linked_list.rs12
1 files 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 ddec1afbc..a312178b3 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 {
203 todo!("this function has not been converted to volatile semantics"); 203 todo!("this function has not been converted to volatile semantics");
204 } 204 }
205 205
206 pub unsafe fn get_next_node(mut p_ref_node: *mut LinkedListNode, mut p_node: *mut *mut LinkedListNode) { 206 pub unsafe fn get_next_node(mut p_ref_node: *mut LinkedListNode) -> *mut LinkedListNode {
207 interrupt::free(|_| { 207 interrupt::free(|_| {
208 let ref_node = ptr::read_volatile(p_ref_node); 208 let ref_node = ptr::read_volatile(p_ref_node);
209 209
210 // Allowed because a removed node is not seen by another core 210 // Allowed because a removed node is not seen by another core
211 *p_node = ref_node.next; 211 ref_node.next
212 }); 212 })
213 } 213 }
214 214
215 pub unsafe fn get_prev_node(mut p_ref_node: *mut LinkedListNode, mut p_node: *mut *mut LinkedListNode) { 215 pub unsafe fn get_prev_node(mut p_ref_node: *mut LinkedListNode) -> *mut LinkedListNode {
216 interrupt::free(|_| { 216 interrupt::free(|_| {
217 let ref_node = ptr::read_volatile(p_ref_node); 217 let ref_node = ptr::read_volatile(p_ref_node);
218 218
219 // Allowed because a removed node is not seen by another core 219 // Allowed because a removed node is not seen by another core
220 *p_node = ref_node.prev; 220 ref_node.prev
221 }); 221 })
222 } 222 }
223} 223}
224 224