Changeset feeac0d in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2013-09-10T16:32:35Z (12 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4982d87
Parents:
e8d6ce2
Message:

Simplify use of list_foreach.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    re8d6ce2 rfeeac0d  
    496496driver_t *find_best_match_driver(driver_list_t *drivers_list, dev_node_t *node)
    497497{
    498         driver_t *best_drv = NULL, *drv = NULL;
     498        driver_t *best_drv = NULL;
    499499        int best_score = 0, score = 0;
    500500       
    501501        fibril_mutex_lock(&drivers_list->drivers_mutex);
    502502       
    503         list_foreach(drivers_list->drivers, link) {
    504                 drv = list_get_instance(link, driver_t, drivers);
     503        list_foreach(drivers_list->drivers, drivers, driver_t, drv) {
    505504                score = get_match_score(drv, node);
    506505                if (score > best_score) {
     
    596595{
    597596        driver_t *res = NULL;
    598         driver_t *drv = NULL;
    599597       
    600598        fibril_mutex_lock(&drv_list->drivers_mutex);
    601599       
    602         list_foreach(drv_list->drivers, link) {
    603                 drv = list_get_instance(link, driver_t, drivers);
     600        list_foreach(drv_list->drivers, drivers, driver_t, drv) {
    604601                if (str_cmp(drv->name, drv_name) == 0) {
    605602                        res = drv;
     
    11311128
    11321129        size_t pos = 0;
    1133         list_foreach(dev->functions, item) {
    1134                 fun_node_t *fun =
    1135                     list_get_instance(item, fun_node_t, dev_functions);
    1136 
     1130        list_foreach(dev->functions, dev_functions, fun_node_t, fun) {
    11371131                if (pos < buf_cnt) {
    11381132                        hdl_buf[pos] = fun->handle;
     
    14721466        assert(fibril_rwlock_is_locked(&tree->rwlock));
    14731467
    1474         fun_node_t *fun;
    1475 
    1476         list_foreach(dev->functions, link) {
    1477                 fun = list_get_instance(link, fun_node_t, dev_functions);
    1478 
     1468        list_foreach(dev->functions, dev_functions, fun_node_t, fun) {
    14791469                if (str_cmp(name, fun->name) == 0) {
    14801470                        fun_add_ref(fun);
Note: See TracChangeset for help on using the changeset viewer.