mirror of https://gitlab.com/qemu-project/dtc.git
dtc: Use streq() in preference to strcmp()
dtc defines a streq() (string equality) macro to avoid the easy confusion of the sense of strcmp() comparison for equality. A few places where we don't use it have slipped in, so remove them. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
852e9ecbe1
commit
120775eb1c
2
checks.c
2
checks.c
|
@ -325,7 +325,7 @@ static void check_property_name_chars_strict(struct check *c,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Certain names are whitelisted */
|
/* Certain names are whitelisted */
|
||||||
if (strcmp(name, "device_type") == 0)
|
if (streq(name, "device_type"))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -242,7 +242,7 @@ void delete_property_by_name(struct node *node, char *name)
|
||||||
struct property *prop = node->proplist;
|
struct property *prop = node->proplist;
|
||||||
|
|
||||||
while (prop) {
|
while (prop) {
|
||||||
if (!strcmp(prop->name, name)) {
|
if (streq(prop->name, name)) {
|
||||||
delete_property(prop);
|
delete_property(prop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ void delete_node_by_name(struct node *parent, char *name)
|
||||||
struct node *node = parent->children;
|
struct node *node = parent->children;
|
||||||
|
|
||||||
while (node) {
|
while (node) {
|
||||||
if (!strcmp(node->name, name)) {
|
if (streq(node->name, name)) {
|
||||||
delete_node(node);
|
delete_node(node);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue