Changeset b72efe8 in mainline for uspace/srv/devman/devman.c
- Timestamp:
- 2011-06-19T14:38:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 74464e8
- Parents:
- 1d1bb0f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
r1d1bb0f rb72efe8 466 466 fibril_mutex_lock(&drivers_list->drivers_mutex); 467 467 468 link_t *link = drivers_list->drivers.next; 469 while (link != &drivers_list->drivers) { 468 list_foreach(drivers_list->drivers, link) { 470 469 drv = list_get_instance(link, driver_t, drivers); 471 470 score = get_match_score(drv, node); … … 474 473 best_drv = drv; 475 474 } 476 link = link->next;477 475 } 478 476 … … 536 534 driver_t *res = NULL; 537 535 driver_t *drv = NULL; 538 link_t *link;539 536 540 537 fibril_mutex_lock(&drv_list->drivers_mutex); 541 538 542 link = drv_list->drivers.next; 543 while (link != &drv_list->drivers) { 539 list_foreach(drv_list->drivers, link) { 544 540 drv = list_get_instance(link, driver_t, drivers); 545 541 if (str_cmp(drv->name, drv_name) == 0) { … … 547 543 break; 548 544 } 549 550 link = link->next;551 545 } 552 546 … … 584 578 * that has not been passed to the driver. 585 579 */ 586 link = driver->devices. next;587 while (link != &driver->devices ) {580 link = driver->devices.head.next; 581 while (link != &driver->devices.head) { 588 582 dev = list_get_instance(link, dev_node_t, driver_devices); 589 583 if (dev->passed_to_driver) { … … 622 616 * Restart the cycle to go through all devices again. 623 617 */ 624 link = driver->devices. next;618 link = driver->devices.head.next; 625 619 } 626 620 … … 1187 1181 1188 1182 fun_node_t *fun; 1189 link_t *link; 1190 1191 for (link = dev->functions.next; 1192 link != &dev->functions; 1193 link = link->next) { 1183 1184 list_foreach(dev->functions, link) { 1194 1185 fun = list_get_instance(link, fun_node_t, dev_functions); 1195 1186 … … 1385 1376 { 1386 1377 dev_class_t *cl; 1387 link_t *link = class_list->classes.next; 1388 1389 while (link != &class_list->classes) { 1378 1379 list_foreach(class_list->classes, link) { 1390 1380 cl = list_get_instance(link, dev_class_t, link); 1391 1381 if (str_cmp(cl->name, class_name) == 0) { 1392 1382 return cl; 1393 1383 } 1394 link = link->next;1395 1384 } 1396 1385 … … 1408 1397 assert(dev_name != NULL); 1409 1398 1410 link_t *link; 1411 for (link = dev_class->devices.next; 1412 link != &dev_class->devices; 1413 link = link->next) { 1399 list_foreach(dev_class->devices, link) { 1414 1400 dev_class_info_t *dev = list_get_instance(link, 1415 1401 dev_class_info_t, link);
Note:
See TracChangeset
for help on using the changeset viewer.