FreeBSD/sys/dev/isci/scil/sci_abstract_list.c
/**
 * This method will simply remove the element at the back (tail) of the list.
 * It will return a pointer to the object that was removed or NULL if not
 * found.
 */
This method will simply remove the element at the back (tail) of the list.
It will return a pointer to the object that was removed or NULL if not
found.
This method will simply remove the element at the back ( tail ) of the list . It will return a pointer to the object that was removed or NULL if not found .
void * sci_abstract_list_popback(
   SCI_ABSTRACT_LIST_T * list_p
)
{
   SCI_ABSTRACT_ELEMENT_LIST_T * elem_list = &(list_p)->elements;
   SCI_ABSTRACT_ELEMENT_T      * alElement_p = elem_list->back_p;
   void * obj_p = NULL;
   if (alElement_p != NULL)
   {
      obj_p = alElement_p->object_p;
      if (elem_list->back_p == elem_list->front_p)
      {
         elem_list->back_p = elem_list->front_p = NULL;
      }
      else
      {
         elem_list->back_p = elem_list->back_p->previous_p;
         elem_list->back_p->next_p = NULL;
      }
      elem_list->size--;
      private_pool_free((list_p)->free_pool, alElement_p);
   }
   return obj_p;
}
void * sci_abstract_list_popback ( SCI_ABSTRACT_LIST_T * list_p ) { SCI_ABSTRACT_ELEMENT_LIST_T * elem_list = & ( list_p ) -> elements ; SCI_ABSTRACT_ELEMENT_T * alElement_p = elem_list -> back_p ; void * obj_p = NULL ; if ( alElement_p != NULL ) { obj_p = alElement_p -> object_p ; if ( elem_list -> back_p == elem_list -> front_p ) { elem_list -> back_p = elem_list -> front_p = NULL ; } else { elem_list -> back_p = elem_list -> back_p -> previous_p ; elem_list -> back_p -> next_p = NULL ; } elem_list -> size -- ; private_pool_free ( ( list_p ) -> free_pool , alElement_p ) ; } return obj_p ; }
This method will simply remove the element at the back (tail) of the list.
This method will simply remove the element at the back ( tail ) of the list .