Changeset 8b9a443 in mainline
- Timestamp:
- 2012-03-02T14:55:34Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- dabbe28
- Parents:
- 76f382b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/ofw/ofw_tree.c
r76f382b r8b9a443 65 65 const char *name) 66 66 { 67 size_t i; 68 69 for (i = 0; i < node->properties; i++) { 67 for (size_t i = 0; i < node->properties; i++) { 70 68 if (str_cmp(node->property[i].name, name) == 0) 71 69 return &node->property[i]; … … 104 102 const char *name) 105 103 { 106 ofw_tree_node_t *cur;107 108 104 /* 109 105 * Try to find the disambigued name. 110 106 */ 111 for ( cur = node->child; cur; cur = cur->peer) {107 for (ofw_tree_node_t *cur = node->child; cur; cur = cur->peer) { 112 108 if (str_cmp(cur->da_name, name) == 0) 113 109 return cur; … … 121 117 * are not always fully-qualified. 122 118 */ 123 for ( cur = node->child; cur; cur = cur->peer) {119 for (ofw_tree_node_t *cur = node->child; cur; cur = cur->peer) { 124 120 if (str_cmp(ofw_tree_node_name(cur), name) == 0) 125 121 return cur; … … 141 137 const char *dtype) 142 138 { 143 ofw_tree_node_t *cur; 144 145 for (cur = node->child; cur; cur = cur->peer) { 139 for (ofw_tree_node_t *cur = node->child; cur; cur = cur->peer) { 146 140 ofw_tree_property_t *prop = 147 141 ofw_tree_getprop(cur, "device_type"); … … 172 166 phandle handle) 173 167 { 174 ofw_tree_node_t *cur; 175 176 for (cur = root; cur; cur = cur->peer) { 168 for (ofw_tree_node_t *cur = root; cur; cur = cur->peer) { 177 169 if (cur->node_handle == handle) 178 170 return cur; 179 171 180 172 if (cur->child) { 181 ofw_tree_node_t *node 182 =ofw_tree_find_node_by_handle(cur->child, handle);173 ofw_tree_node_t *node = 174 ofw_tree_find_node_by_handle(cur->child, handle); 183 175 if (node) 184 176 return node; … … 201 193 const char *dtype) 202 194 { 203 ofw_tree_node_t *cur; 204 205 for (cur = node->peer; cur; cur = cur->peer) { 195 for (ofw_tree_node_t *cur = node->peer; cur; cur = cur->peer) { 206 196 ofw_tree_property_t *prop = 207 197 ofw_tree_getprop(cur, "device_type"); … … 229 219 const char *name) 230 220 { 231 ofw_tree_node_t *cur; 232 233 for (cur = node->peer; cur; cur = cur->peer) { 234 ofw_tree_property_t *prop 235 = ofw_tree_getprop(cur, "name"); 221 for (ofw_tree_node_t *cur = node->peer; cur; cur = cur->peer) { 222 ofw_tree_property_t *prop = 223 ofw_tree_getprop(cur, "name"); 236 224 237 225 if ((!prop) || (!prop->value)) … … 259 247 260 248 ofw_tree_node_t *node = ofw_root; 261 size_t i;262 249 size_t j; 263 250 264 for ( i = 1; (i < str_size(path)) && (node); i = j + 1) {251 for (size_t i = 1; (i < str_size(path)) && (node); i = j + 1) { 265 252 for (j = i; (j < str_size(path)) && (path[j] != '/'); j++); 266 253 … … 294 281 const char *dtype, ofw_tree_walker_t walker, void *arg) 295 282 { 296 ofw_tree_node_t *cur; 297 298 for (cur = node; cur; cur = cur->peer) { 283 for (ofw_tree_node_t *cur = node; cur; cur = cur->peer) { 299 284 ofw_tree_property_t *prop = 300 285 ofw_tree_getprop(cur, "device_type");
Note:
See TracChangeset
for help on using the changeset viewer.