Changeset f959a20f in mainline for uspace/lib/c/include/ipc/devman.h


Ignore:
Timestamp:
2019-02-01T22:32:38Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
00b7fc8
Parents:
1a37496
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 21:22:39)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-02-01 22:32:38)
Message:

Avoid directly using .head/.next/.prev of list_t/link_t

Use existing constructs from <adt/list.h> instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/ipc/devman.h

    r1a37496 rf959a20f  
    108108static inline void add_match_id(match_id_list_t *ids, match_id_t *id)
    109109{
    110         match_id_t *mid = NULL;
    111         link_t *link = ids->ids.head.next;
    112 
    113         while (link != &ids->ids.head) {
    114                 mid = list_get_instance(link, match_id_t, link);
     110        list_foreach(ids->ids, link, match_id_t, mid) {
    115111                if (mid->score < id->score) {
    116                         break;
     112                        list_insert_before(&id->link, &mid->link);
     113                        return;
    117114                }
    118                 link = link->next;
    119115        }
    120116
    121         list_insert_before(&id->link, link);
     117        list_append(&id->link, &ids->ids);
    122118}
    123119
Note: See TracChangeset for help on using the changeset viewer.