Changeset f959a20f in mainline for uspace/srv/devman/driver.c


Ignore:
Timestamp:
2019-02-01T22:32:38Z (6 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/srv/devman/driver.c

    r1a37496 rf959a20f  
    435435         * that has not been passed to the driver.
    436436         */
    437         link = driver->devices.head.next;
    438         while (link != &driver->devices.head) {
     437        link = list_first(&driver->devices);
     438        while (link != NULL) {
    439439                dev = list_get_instance(link, dev_node_t, driver_devices);
    440440                fibril_rwlock_write_lock(&tree->rwlock);
     
    442442                if (dev->passed_to_driver) {
    443443                        fibril_rwlock_write_unlock(&tree->rwlock);
    444                         link = link->next;
     444                        link = list_next(link, &driver->devices);
    445445                        continue;
    446446                }
     
    484484                 * Restart the cycle to go through all devices again.
    485485                 */
    486                 link = driver->devices.head.next;
     486                link = list_first(&driver->devices);
    487487        }
    488488
Note: See TracChangeset for help on using the changeset viewer.