Browse Source

checks: Change node-name check to match devicetree spec

The devicetree spec limits the valid character set to:
  A-Z
  a-z
  0-9
  ,._+-

while property can additionally have '?#'.  Change the check to match
the spec.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Message-Id: <20210209184641.63052-1-kumar.gala@linaro.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Kumar Gala 4 years ago committed by David Gibson
parent
commit
9d2279e7e6
  1. 7
      checks.c

7
checks.c

@ -297,7 +297,8 @@ ERROR(duplicate_property_names, check_duplicate_property_names, NULL);
#define LOWERCASE "abcdefghijklmnopqrstuvwxyz" #define LOWERCASE "abcdefghijklmnopqrstuvwxyz"
#define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ" #define UPPERCASE "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define DIGITS "0123456789" #define DIGITS "0123456789"
#define PROPNODECHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-" #define NODECHARS LOWERCASE UPPERCASE DIGITS ",._+-@"
#define PROPCHARS LOWERCASE UPPERCASE DIGITS ",._+*#?-"
#define PROPNODECHARSSTRICT LOWERCASE UPPERCASE DIGITS ",-" #define PROPNODECHARSSTRICT LOWERCASE UPPERCASE DIGITS ",-"


static void check_node_name_chars(struct check *c, struct dt_info *dti, static void check_node_name_chars(struct check *c, struct dt_info *dti,
@ -309,7 +310,7 @@ static void check_node_name_chars(struct check *c, struct dt_info *dti,
FAIL(c, dti, node, "Bad character '%c' in node name", FAIL(c, dti, node, "Bad character '%c' in node name",
node->name[n]); node->name[n]);
} }
ERROR(node_name_chars, check_node_name_chars, PROPNODECHARS "@"); ERROR(node_name_chars, check_node_name_chars, NODECHARS);


static void check_node_name_chars_strict(struct check *c, struct dt_info *dti, static void check_node_name_chars_strict(struct check *c, struct dt_info *dti,
struct node *node) struct node *node)
@ -370,7 +371,7 @@ static void check_property_name_chars(struct check *c, struct dt_info *dti,
prop->name[n]); prop->name[n]);
} }
} }
ERROR(property_name_chars, check_property_name_chars, PROPNODECHARS); ERROR(property_name_chars, check_property_name_chars, PROPCHARS);


static void check_property_name_chars_strict(struct check *c, static void check_property_name_chars_strict(struct check *c,
struct dt_info *dti, struct dt_info *dti,

Loading…
Cancel
Save