Skip to content

Commit

Permalink
[POWERPC] Use strcasecmp() rather than strncasecmp() when determining…
Browse files Browse the repository at this point in the history
… device node compatibility

The current code assumes "foo-bar" must always be compatible with a node
compatible with "foo", which breaks device trees where this is not so.

The "case" part is also wrong according to Open Firmware, but it's more
likely to have drivers and/or device trees depending on it, and thus
needs to be handled more carefully.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Scott Wood authored and Paul Mackerras committed Aug 22, 2007
1 parent 12cdac3 commit 804ace8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/asm-powerpc/prom.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1
#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1

#define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l))
#define of_compat_cmp(s1, s2, l) strcasecmp((s1), (s2))
#define of_prop_cmp(s1, s2) strcmp((s1), (s2))
#define of_node_cmp(s1, s2) strcasecmp((s1), (s2))

Expand Down

0 comments on commit 804ace8

Please sign in to comment.