Changeset 14a60e3 in mainline


Ignore:
Timestamp:
2011-09-09T15:06:40Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c014d1
Parents:
359f429
Message:

port uspace list improvements to kernel

Location:
kernel/generic
Files:
2 edited

Legend:

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

    r359f429 r14a60e3  
    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}
  • kernel/generic/src/adt/list.c

    r359f429 r14a60e3  
    4949 * @param list  List to look in.
    5050 *
    51  * @return true if link is contained in head, false otherwise.
     51 * @return true if link is contained in list, false otherwise.
    5252 *
    5353 */
Note: See TracChangeset for help on using the changeset viewer.