Changes in uspace/srv/devman/devman.c [7beb220:d0dd7b5] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/devman/devman.c
r7beb220 rd0dd7b5 920 920 } 921 921 922 /** Get list of device functions. */923 int dev_get_functions(dev_tree_t *tree, dev_node_t *dev,924 devman_handle_t *hdl_buf, size_t buf_size, size_t *act_size)925 {926 size_t act_cnt;927 size_t buf_cnt;928 929 assert(fibril_rwlock_is_locked(&tree->rwlock));930 931 buf_cnt = buf_size / sizeof(devman_handle_t);932 933 act_cnt = list_count(&dev->functions);934 *act_size = act_cnt * sizeof(devman_handle_t);935 936 if (buf_size % sizeof(devman_handle_t) != 0)937 return EINVAL;938 939 size_t pos = 0;940 list_foreach(dev->functions, item) {941 fun_node_t *fun =942 list_get_instance(item, fun_node_t, dev_functions);943 944 if (pos < buf_cnt)945 hdl_buf[pos] = fun->handle;946 pos++;947 }948 949 return EOK;950 }951 952 953 922 /* Function nodes */ 954 923 … … 1176 1145 char *rel_path = path; 1177 1146 char *next_path_elem = NULL; 1178 bool cont = (rel_path[1] != '\0');1147 bool cont = true; 1179 1148 1180 1149 while (cont && fun != NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.