Changeset f959a20f in mainline for uspace/srv/devman/match.c
- Timestamp:
- 2019-02-01T22:32:38Z (6 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/match.c
r1a37496 rf959a20f 67 67 int get_match_score(driver_t *drv, dev_node_t *dev) 68 68 { 69 link_t *drv_head = &drv->match_ids.ids.head; 70 link_t *dev_head = &dev->pfun->match_ids.ids.head; 71 72 if (list_empty(&drv->match_ids.ids) || 73 list_empty(&dev->pfun->match_ids.ids)) { 69 list_t *drv_list = &drv->match_ids.ids; 70 list_t *dev_list = &dev->pfun->match_ids.ids; 71 72 if (list_empty(drv_list) || list_empty(dev_list)) 74 73 return 0; 75 }76 74 77 75 /* … … 80 78 int highest_score = 0; 81 79 82 link_t *drv_link = drv->match_ids.ids.head.next; 83 while (drv_link != drv_head) { 84 link_t *dev_link = dev_head->next; 85 while (dev_link != dev_head) { 86 match_id_t *drv_id = list_get_instance(drv_link, match_id_t, link); 87 match_id_t *dev_id = list_get_instance(dev_link, match_id_t, link); 88 80 list_foreach(*drv_list, link, match_id_t, drv_id) { 81 list_foreach(*dev_list, link, match_id_t, dev_id) { 89 82 int score = compute_match_score(drv_id, dev_id); 90 if (score > highest_score) {83 if (score > highest_score) 91 84 highest_score = score; 92 }93 94 dev_link = dev_link->next;95 85 } 96 97 drv_link = drv_link->next;98 86 } 99 87
Note:
See TracChangeset
for help on using the changeset viewer.