From 383bef1711d5d6464e49dfe9722e0fa3dd5a4ad9 Mon Sep 17 00:00:00 2001 From: xoviat Date: Sat, 20 May 2023 10:20:35 -0500 Subject: [PATCH] stm32/ipcc: naming --- .../src/tl_mbox/unsafe_linked_list.rs | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/embassy-stm32/src/tl_mbox/unsafe_linked_list.rs b/embassy-stm32/src/tl_mbox/unsafe_linked_list.rs index 45bf5bdae..482e2bf5a 100644 --- a/embassy-stm32/src/tl_mbox/unsafe_linked_list.rs +++ b/embassy-stm32/src/tl_mbox/unsafe_linked_list.rs @@ -30,29 +30,29 @@ impl Default for LinkedListNode { } impl LinkedListNode { - pub unsafe fn init_head(mut listHead: *mut LinkedListNode) { - (*listHead).next = listHead; - (*listHead).prev = listHead; + pub unsafe fn init_head(mut list_head: *mut LinkedListNode) { + (*list_head).next = list_head; + (*list_head).prev = list_head; } - pub unsafe fn is_empty(mut listHead: *mut LinkedListNode) -> bool { - interrupt::free(|_| ((*listHead).next) == listHead) + pub unsafe fn is_empty(mut list_head: *mut LinkedListNode) -> bool { + interrupt::free(|_| ((*list_head).next) == list_head) } - pub unsafe fn insert_head(mut listHead: *mut LinkedListNode, mut node: *mut LinkedListNode) { + pub unsafe fn insert_head(mut list_head: *mut LinkedListNode, mut node: *mut LinkedListNode) { interrupt::free(|_| { - (*node).next = (*listHead).next; - (*node).prev = listHead; - (*listHead).next = node; + (*node).next = (*list_head).next; + (*node).prev = list_head; + (*list_head).next = node; (*(*node).next).prev = node; }); } - pub unsafe fn insert_tail(mut listHead: *mut LinkedListNode, mut node: *mut LinkedListNode) { + pub unsafe fn insert_tail(mut list_head: *mut LinkedListNode, mut node: *mut LinkedListNode) { interrupt::free(|_| { - (*node).next = listHead; - (*node).prev = (*listHead).prev; - (*listHead).prev = node; + (*node).next = list_head; + (*node).prev = (*list_head).prev; + (*list_head).prev = node; (*(*node).prev).next = node; }); } @@ -64,17 +64,17 @@ impl LinkedListNode { }); } - pub unsafe fn remove_head(mut listHead: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) { + pub unsafe fn remove_head(mut list_head: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) { interrupt::free(|_| { - *node = (*listHead).next; - Self::remove_node((*listHead).next); + *node = (*list_head).next; + Self::remove_node((*list_head).next); }); } - pub unsafe fn remove_tail(mut listHead: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) { + pub unsafe fn remove_tail(mut list_head: *mut LinkedListNode, mut node: *mut *mut LinkedListNode) { interrupt::free(|_| { - *node = (*listHead).prev; - Self::remove_node((*listHead).prev); + *node = (*list_head).prev; + Self::remove_node((*list_head).prev); }); } @@ -96,13 +96,13 @@ impl LinkedListNode { }); } - pub unsafe fn get_size(mut listHead: *mut LinkedListNode) -> usize { + pub unsafe fn get_size(mut list_head: *mut LinkedListNode) -> usize { interrupt::free(|_| { let mut size = 0; let mut temp: *mut LinkedListNode = core::ptr::null_mut::(); - temp = (*listHead).next; - while temp != listHead { + temp = (*list_head).next; + while temp != list_head { size += 1; temp = (*temp).next }