You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/08/26 17:38:45 UTC

[GitHub] [incubator-nuttx] pkarashchenko commented on a diff in pull request #6926: list.h: Change inline function to macro as much as possbile

pkarashchenko commented on code in PR #6926:
URL: https://github.com/apache/incubator-nuttx/pull/6926#discussion_r956262713


##########
include/nuttx/list.h:
##########
@@ -299,102 +311,6 @@ list_remove_tail(FAR struct list_node *list)
     }
 }
 
-static inline FAR struct list_node *
-list_peek_head(FAR struct list_node *list)
-{
-  if (list->next != list)
-    {
-      return list->next;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static inline FAR struct list_node *
-list_peek_tail(FAR struct list_node *list)
-{
-  if (list->prev != list)
-    {
-      return list->prev;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static inline FAR struct list_node *list_prev(FAR struct list_node *list,
-                                              FAR struct list_node *item)
-{
-  if (item->prev != list)
-    {
-      return item->prev;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static inline FAR struct list_node *
-list_prev_wrap(FAR struct list_node *list, FAR struct list_node *item)
-{
-  if (item->prev != list)
-    {
-      return item->prev;
-    }
-  else if (item->prev->prev != list)
-    {
-      return item->prev->prev;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static inline FAR struct list_node *list_next(FAR struct list_node *list,
-                                              FAR struct list_node *item)
-{
-  if (item->next != list)
-    {
-      return item->next;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static inline FAR struct list_node *
-list_next_wrap(FAR struct list_node *list, FAR struct list_node *item)
-{
-  if (item->next != list)
-    {
-      return item->next;
-    }
-  else if (item->next->next != list)
-    {
-      return item->next->next;
-    }
-  else
-    {
-      return NULL;
-    }
-}
-
-static inline bool list_is_empty(FAR struct list_node *list)
-{
-  return list->next == list;
-}
-
-static inline bool list_is_clear(FAR struct list_node *list)
-{
-  return list->next == NULL;
-}
-
 static inline size_t list_length(FAR struct list_node *list)

Review Comment:
   So this will be changed in next P?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org