Changeset 432a269 in mainline for kernel/generic/include/adt/list.h


Ignore:
Timestamp:
2011-09-16T21:13:57Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a11f17
Parents:
c0e53ff (diff), fd07e526 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/list.h

    rc0e53ff r432a269  
    7272
    7373#define assert_link_not_used(link) \
    74         ASSERT((link)->prev == NULL && (link)->next == NULL)
     74        ASSERT(((link)->prev == NULL) && ((link)->next == NULL))
    7575
    7676/** Initialize doubly-linked circular list link
     
    158158NO_TRACE static inline void list_remove(link_t *link)
    159159{
    160         link->next->prev = link->prev;
    161         link->prev->next = link->next;
     160        if ((link->prev != NULL) && (link->next != NULL)) {
     161                link->next->prev = link->prev;
     162                link->prev->next = link->next;
     163        }
     164       
    162165        link_initialize(link);
    163166}
     
    170173 *
    171174 */
    172 NO_TRACE static inline int list_empty(list_t *list)
     175NO_TRACE static inline int list_empty(const list_t *list)
    173176{
    174177        return (list->head.next == &list->head);
     
    183186 *
    184187 */
    185 static inline link_t *list_first(list_t *list)
     188static inline link_t *list_first(const list_t *list)
    186189{
    187190        return ((list->head.next == &list->head) ? NULL : list->head.next);
Note: See TracChangeset for help on using the changeset viewer.