Deleted Added
sdiff udiff text old ( 204431 ) new ( 204433 )
full compact
1/*
2 * (C) Copyright David Gibson <dwg@au1.ibm.com>, IBM Corporation. 2007.
3 *
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.

--- 265 unchanged lines hidden (view full) ---

274
275 if (n < strlen(prop->name))
276 FAIL(c, "Bad character '%c' in property name \"%s\", node %s",
277 prop->name[n], prop->name, node->fullpath);
278}
279PROP_CHECK(property_name_chars, PROPNODECHARS, ERROR);
280
281static void check_explicit_phandles(struct check *c, struct node *root,
282 struct node *node)
283{
284 struct property *prop;
285 struct node *other;
286 cell_t phandle;
287
288 prop = get_property(node, "linux,phandle");
289 if (! prop)
290 return; /* No phandle, that's fine */
291
292 if (prop->val.len != sizeof(cell_t)) {
293 FAIL(c, "%s has bad length (%d) linux,phandle property",
294 node->fullpath, prop->val.len);
295 return;
296 }
297
298 phandle = propval_cell(prop);
299 if ((phandle == 0) || (phandle == -1)) {
300 FAIL(c, "%s has invalid linux,phandle value 0x%x",
301 node->fullpath, phandle);
302 return;
303 }
304
305 other = get_node_by_phandle(root, phandle);
306 if (other) {
307 FAIL(c, "%s has duplicated phandle 0x%x (seen before at %s)",
308 node->fullpath, phandle, other->fullpath);
309 return;
310 }
311
312 node->phandle = phandle;
313}
314NODE_CHECK(explicit_phandles, NULL, ERROR);
315
316static void check_name_properties(struct check *c, struct node *root,
317 struct node *node)
318{
319 struct property **pp, *prop = NULL;
320
321 for (pp = &node->proplist; *pp; pp = &((*pp)->next))
322 if (streq((*pp)->name, "name")) {

--- 265 unchanged lines hidden ---