Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 4376 → Rev 4377

/branches/tracing/kernel/genarch/src/ofw/ofw_tree.c
38,7 → 38,7
#include <genarch/ofw/ofw_tree.h>
#include <arch/memstr.h>
#include <mm/slab.h>
#include <func.h>
#include <string.h>
#include <print.h>
#include <panic.h>
 
66,7 → 66,7
unsigned int i;
for (i = 0; i < node->properties; i++) {
if (strcmp(node->property[i].name, name) == 0)
if (str_cmp(node->property[i].name, name) == 0)
return &node->property[i];
}
 
85,10 → 85,10
prop = ofw_tree_getprop(node, "name");
if (!prop)
panic("Node without name property.\n");
panic("Node without name property.");
if (prop->size < 2)
panic("Invalid name property.\n");
panic("Invalid name property.");
return prop->value;
}
109,7 → 109,7
* Try to find the disambigued name.
*/
for (cur = node->child; cur; cur = cur->peer) {
if (strcmp(cur->da_name, name) == 0)
if (str_cmp(cur->da_name, name) == 0)
return cur;
}
121,7 → 121,7
* are not always fully-qualified.
*/
for (cur = node->child; cur; cur = cur->peer) {
if (strcmp(ofw_tree_node_name(cur), name) == 0)
if (str_cmp(ofw_tree_node_name(cur), name) == 0)
return cur;
}
146,7 → 146,7
prop = ofw_tree_getprop(cur, "device_type");
if (!prop || !prop->value)
continue;
if (strcmp(prop->value, name) == 0)
if (str_cmp(prop->value, name) == 0)
return cur;
}
203,7 → 203,7
prop = ofw_tree_getprop(cur, "device_type");
if (!prop || !prop->value)
continue;
if (strcmp(prop->value, name) == 0)
if (str_cmp(prop->value, name) == 0)
return cur;
}
229,7 → 229,7
prop = ofw_tree_getprop(cur, "name");
if (!prop || !prop->value)
continue;
if (strcmp(prop->value, name) == 0)
if (str_cmp(prop->value, name) == 0)
return cur;
}
252,14 → 252,15
if (path[0] != '/')
return NULL;
for (i = 1; i < strlen(path) && node; i = j + 1) {
for (j = i; j < strlen(path) && path[j] != '/'; j++)
;
if (i == j) /* skip extra slashes */
for (i = 1; (i < str_size(path)) && (node); i = j + 1) {
for (j = i; (j < str_size(path)) && (path[j] != '/'); j++);
/* Skip extra slashes */
if (i == j)
continue;
memcpy(buf, &path[i], j - i);
buf[j - i] = '\0';
buf[j - i] = 0;
node = ofw_tree_find_child(node, buf);
}