aboutsummaryrefslogtreecommitdiff
path: root/checks.c
AgeCommit message (Collapse)AuthorFilesLines
2017-12-15checks: add chosen node checksRob Herring1-0/+51
Add some checks for /chosen node. These check that chosen is located at the root level and that bootargs and stdout-path properties are strings. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-12-13checks: add aliases node checksRob Herring1-0/+24
Add checks for aliases node that all properties follow alias naming convention and the values are a valid path. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-12-13checks: check for #{size,address}-cells without child nodesRob Herring1-0/+26
Add a check for unnecessary "#{size,address}-cells" when there's neither a 'ranges' property nor child nodes with a 'reg' property. An exception may be an overlay that adds nodes, but this case would need "#{size,address}-cells" in the overlay to properly compile already. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-12-13checks: add string list check for *-names propertiesRob Herring1-1/+17
Add a string list check for common properties ending in "-names" such as reg-names or interrupt-names. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-12-13checks: add string list checkRob Herring1-0/+34
Add a check for string list properties with compatible being the first check. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-12-13checks: add a string check for 'label' propertyRob Herring1-0/+2
Add a string property check for 'label' property. 'label' is a human readable string typically used to identify connectors or ports on devices. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-12-05checks: fix sound-dai phandle with arg property checkPeter Rosin1-2/+2
The property is named "sound-dai", not "sound-dais". Fixes: b3bbac02d5e3 ("checks: add phandle with arg property checks") Signed-off-by: Peter Rosin <peda@axentia.se> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-11-11Fix widespread incorrect use of strneq(), replace with new strprefixeq()David Gibson1-3/+3
Every remaining usage of strneq() is, in fact, incorrect. They're trying to check that the first n characters of one string exactly match another string. But, they fall into the classic trap of strncmp() on which strneq() is based. If n is less than the length of the second string, they only check that the first string matches the start of the second, not the whole of it. To fix this, remove strneq() and replace it with a strprefixeq() function which does what we want here. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-10-26Remove leading underscores from identifiersDavid Gibson1-16/+16
In a number of places, dtc and associated tools and test code use leading _ characters on identifiers to flag them as "internal", an idiom taken from the Linux kernel. This is a bad idea in a userspace program, because identifiers with a leading _ are reserved for the C library / system. In some cases, the extra _ served no real purpose, so simply drop it. In others move to the end of the identifier, which is a convention we're free to use for our own purposes. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-10-19checks: fix handling of unresolved phandles for dts pluginsRob Herring1-0/+9
In dts plugins, it is valid to have unresolved phandle values. The check_property_phandle_args and check_interrupts_property checks failed to account for this resulting in spurious warnings or asserts, respectively. Fix this by bailing from the checks if we're checking a dts plugin as there is no way to further validate the properties. Fixes: ee3d26f6960b ("checks: add interrupts property check") Fixes: b3bbac02d5e3 ("checks: add phandle with arg property checks") Reported-by: Alan Tull <atull@kernel.org> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-28checks: Use proper format modifier for size_tThierry Reding1-2/+2
The size of size_t can vary between architectures, so using %ld isn't going to work on 32-bit builds. Use the %zu modifier to make sure it is always correct. Signed-off-by: Thierry Reding <treding@nvidia.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-22checks: add interrupts property checkRob Herring1-0/+81
Add a check for nodes with interrupts property that they have a valid parent, the parent has #interrupt-cells property, and the size is a valid multiple of #interrupt-cells. This may not handle every possible case and doesn't deal with translation thru interrupt-map properties, but should be enough for modern dts files. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-22checks: add gpio binding properties checkRob Herring1-0/+73
The GPIO binding is different compared to other phandle plus args properties in that the property name has a variable, optional prefix. The format of the property name is [<name>-]gpio{s} where <name> can be any legal property string. Therefore, custom matching of property names is needed, but the common check_property_phandle_args() function can still be used. It's possible that there are property names matching which are not GPIO binding specifiers. There's only been one case found in testing which is "[<vendor>,]nr-gpio{s}". This property has been blacklisted and the same should be done to any others we find. This check will prevent getting any more of these, too. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-09-22checks: add phandle with arg property checksRob Herring1-0/+126
Many common bindings follow the same pattern of client properties containing a phandle and N arg cells where N is defined in the provider with a '#<specifier>-cells' property such as: intc0: interrupt-controller@0 { #interrupt-cells = <3>; }; intc1: interrupt-controller@1 { #interrupt-cells = <2>; }; node { interrupts-extended = <&intc0 1 2 3>, <&intc1 4 5>; }; Add checks for properties following this pattern. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-06-08dtc: fix sprintf() format string error, againDavid Gibson1-1/+1
2a42b14 "dtc: check.c fix compile error" changed a format string using %lx which wasn't correct for all platforms. Unfortunately it changed it to %zx, which is wrong for a different set of platforms (and only right on the others by accident). The parameter we're formatting here is uint64_t, not size_t, so we need to use the PRIx64 macro from <inttypes.h> to get this right. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-05-17dtc: check.c fix compile errorShuah Khan1-1/+1
Fix the following compile error found on odroid-xu4: checks.c: In function ‘check_simple_bus_reg’: checks.c:876:41: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t{aka long long unsigned int}’ [-Werror=format=] snprintf(unit_addr, sizeof(unit_addr), "%lx", reg); ^ checks.c:876:41: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t {aka long long unsigned int}’ [-Werror=format=] cc1: all warnings being treated as errors Makefile:304: recipe for target 'checks.o' failed make: *** [checks.o] Error 1 Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com> [dwg: Correct new format to be correct in general] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-21checks: Warn on node name unit-addresses with '0x' or leading 0sRob Herring1-0/+25
Node name unit-addresses should generally never begin with 0x or leading 0s. Add warnings to check for these cases, but only for nodes without a known bus type as there should be better bus specific checks of the unit address in those cases. Any unit addresses that don't follow the general rule will need to add a new bus type. There aren't any known ones ATM. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-21checks: Add bus checks for simple-bus busesRob Herring1-0/+70
Add checks to identify simple-bus bus types and checks for child devices. Simple-bus type is generally identified by "simple-bus" compatible string. We also treat the root as a simple-bus, but only for child nodes with reg property. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-21checks: Add bus checks for PCI busesRob Herring1-0/+136
Add PCI bridge and device node checks. We identify PCI bridges with 'device_type = "pci"' as only PCI bridges should set that property. For bridges, check that node name is pci or pcie, ranges and bus-range are present, and #address-cells and #size-cells are correct. For devices, check the reg property fields are correct for the first element (the config address). Check that the unit address is formatted corectly based on the reg property. Device unit addresses are in the form DD or DD,F where DD is the device 0-0x1f and F is the function 0-7. Also, check that the bus number is within the expected range defined by bridge's bus-ranges. Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rob Herring <robh@kernel.org> [dwg: Added a missing check dependency] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-06Fix assorted sparse warningsDavid Gibson1-2/+2
This fixes a great many sparse warnings on the fdt and libfdt sources. These are mostly due to incorrect mixing of endian annotated and native integer types. This includes fixing a couple of quasi-bugs where we had endian conversions the wrong way around (this will have the right effect in practice, but is certainly conceptually incorrect). This doesn't make the whole tree sparse clean: there are many warnings in bison and lex generated code, and there are a handful of other remaining warnings that are (for now) more trouble than they're worth to fix (and are not genuine bugs). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-03-06Clean up gcc attributesDavid Gibson1-6/+2
We have a number of explicit __GNUC__ conditionals to tell if we want to use some gcc extensions for extra warnings. This cleans this up to use a single conditional, defining convenience macros for those attributes. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-23Print output filename as part of warning messagesIan Campbell1-40/+43
For example: src/arm/at91-ariag25.dtb: Warning (unit_address_vs_reg): Node /memory has a reg or ranges property, but no unit name If output is to stdout then the prefix is "<stdout>: ". This helps to direct the developer to where to look when multiple files are being compiled in parallel. Signed-off-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-13dtc: Use streq() in preference to strcmp()David Gibson1-1/+1
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>
2017-02-13checks: Add Warning for stricter node name character checkingRob Herring1-0/+12
While '#', '?', '.', '+', '*', and '_' are considered valid characters, their use is discouraged in recommended practices. Testing this found a few cases of '.'. The majority of the warnings were all from underscores. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2017-02-13checks: Add Warning for stricter property name character checkingRob Herring1-0/+35
While '?', '.', '+', '*', and '_' are considered valid characters their use is discouraged in recommended practices. '#' is also only recommended to be used at the beginning of property names. Testing this found one typo error with '.' used instead of ','. The rest of the warnings were all from underscores. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09Rename boot_infoDavid Gibson1-43/+43
struct boot_info is named that for historical reasons, and isn't particularly meaningful. Essentially it contains all the information - in "live" form from a single dts or dtb file. As we move towards support for dynamic dt overlays, that name will become increasingly bad. So, in preparation, rename it to dt_info. At the same time rename the 'the_boot_info' global to 'parser_output' since that's its actual purpose. Unfortunately we do need the global unless we switch to bison's re-entrant parser extensions, which would introduce its own complications. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-12-09dtc: Plugin and fixup supportPantelis Antoniou1-2/+6
This patch enable the generation of symbols & local fixup information for trees compiled with the -@ (--symbols) option. Using this patch labels in the tree and their users emit information in __symbols__ and __local_fixups__ nodes. The __fixups__ node make possible the dynamic resolution of phandle references which are present in the plugin tree but lie in the tree that are applying the overlay against. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-11-28checks: Pass boot_info instead of root nodePantelis Antoniou1-36/+42
As preparation for overlay support we need to pass the boot info parameter instead of the root node to each check method. The root node can be retrieved by accessing boot info's dt member. No other functional changes are made. Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-05-27Simplify check field and macro namesDavid Gibson1-42/+36
Now that "node" checks are the only type of checks, simplify some names accordingly. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-05-27Remove property check functionsDavid Gibson1-100/+114
Property checking functions aren't particularly useful. They're used only in a handful of cases, and most of those really only check a small handful of specific properties. This patches converts the few cases to node check functions and removes property check functions entirely. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-05-27Remove tree check functionsDavid Gibson1-37/+32
The tree check functions from the checking infrastructure aren't very useful. There were only two examples using them, and they're basically equivalent to a node check which is applied only to the root node, so those are easily replaced. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2016-02-19Warn on node name unit-address presence/absence mismatchStephen Warren1-0/+26
ePAPR 1.1 section 2.2.1.1 "Node Name Requirements" specifies that any node that has a reg property must include a unit address in its name with value matching the first entry in its reg property. Conversely, if a node does not have a reg property, the node name must not include a unit address. Also allow ranges property as it is deemed valid, but ePAPR is not clear about it. Implement a check for this. The code doesn't validate the format of the unit address; ePAPR implies this may vary from (containing bus) binding to binding, so doing so would be much more complex. Signed-off-by: Stephen Warren <swarren@nvidia.com> [robh: also allow non-empty ranges] Signed-off-by: Rob Herring <robh@kernel.org> [moved new test in check_table] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-04-30Fix crash with poorly defined #size-cellsJack Miller1-1/+1
If you have a parent block with #size-cells improperly set to 0, and then subsequently try to include a regs property in the child, dtc will crash with SIGFPE while validating it. This patch fixes that crash, instead printing the same invalid length warning that was causing it. Test included. Signed-off-by: Jack Miller <jack@codezen.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2015-01-13dtc: Use va_end to match corresponding va_startColin Ian King1-0/+1
Although on some systems va_end is a no-op, it is good practice to use va_end, especially since the manual states: "Each invocation of va_start() must be matched by a corresponding invocation of va_end() in the same function." Signed-off-by: Colin Ian King <colin.king@canonical.com>
2014-10-24Improve portabilityPhil Elwell1-2/+2
1) Remove the double parentheses around two comparisons in checks.c. The OSX LLVM-based C compiler warns about them. 2) Put an explicit "=" in the TN() macro, in accordance with c99. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2014-02-01dtc: fix some more -Wshadow warningsFlorian Fainelli1-5/+5
Building on a RHEL6 system produced the following -Wshadow warnings in fstree.c, util.c and checks.c: cc1: warnings being treated as errors checks.c: In function 'parse_checks_option': checks.c:709: error: declaration of 'optarg' shadows a global declaration /usr/include/getopt.h:59: error: shadowed declaration is here make[1]: *** [checks.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: *** Waiting for unfinished jobs.... cc1: warnings being treated as errors fstree.c: In function 'read_fstree': fstree.c:40: error: declaration of 'tmpnam' shadows a global declaration /usr/include/stdio.h:208: error: shadowed declaration is here make[1]: *** [fstree.o] Error 1 cc1: warnings being treated as errors util.c: In function 'xstrdup': util.c:42: error: declaration of 'dup' shadows a global declaration /usr/include/unistd.h:528: error: shadowed declaration is here Fix all of these -Wshadow warnings by using slightly different variable names which won't collide with anything else. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2013-10-28Use stdbool more widelyDavid Gibson1-8/+8
We already use the C99 bool type from stdbool.h in a few places. However there are many other places we represent boolean values as plain ints. This patch changes that. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-09-06dtc: Add ability to delete nodes and propertiesStephen Warren1-2/+6
dtc currently allows the contents of properties to be changed, and the contents of nodes to be added to. There are situations where removing properties or nodes may be useful. This change implements the following syntax to do that: / { /delete-property/ propname; /delete-node/ nodename; }; or: /delete-node/ &noderef; Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: David Gibson <david@gibson.dropbear.id.au>
2012-07-08Allow toggling of semantic checksDavid Gibson1-3/+81
This patch adds -W and -E options to dtc which allow toggling on and off of the various built in semantic checks on the tree. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2012-07-08Re-work level setting on checks codeDavid Gibson1-55/+62
Currently each of the semantic checks in checks.c has a "level" between IGNORE and ERROR. This single level makes it awkward to implement the semantics we want for toggling the checks on the command line. This patch reworks the code to instead have separate boolean flags for warning and error. At present having both flags set will have the same effect as having just the error flag set, but this can change in the future. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2010-02-24dtc: Allow multiple labels on nodes and propertiesDavid Gibson1-4/+7
At present, both the grammar and our internal data structures mean that there can be only one label on a node or property. This is a fairly arbitrary constraint, given that any number of value labels can appear at the same point, and that in C you can have any number of labels on the same statement. This is pretty much a non-issue now, but it may become important with some of the extensions that Grant and I have in mind. It's not that hard to change, so this patch does so, allowing an arbitrary number of labels on any given node or property. As usual a testcase is added too. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Acked-by: Grant Likely <grant.likely@secretlab.ca>
2010-02-23Disallow re-use of the same label within a dts fileDavid Gibson1-0/+56
Currently, nothing will stop you from re-using the same label string multiple times in a dts, e.g.: / { samelabel: prop1 = "foo"; samelabel: prop2 = "bar"; }; or / { samelabel: prop1 = "foo"; samelabel: subnode { }; }; When using node references by label, this could lead to confusing results (with no warning), and in -Oasm mode will result in output which the assembler will complain about (since it too will have duplicate labels). This patch, therefore, adds code to checks.c to give errors if you attempt to re-use the same label. It treats all labels (node, property, and value) as residing in the same namespace, since the assembler will treat them so for -Oasm mode. Testcases for the new code are also added. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2009-11-26Support ePAPR compliant phandle propertiesDavid Gibson1-14/+20
Currently, the Linux kernel, libfdt and dtc, when using flattened device trees encode a node's phandle into a property named "linux,phandle". The ePAPR specification, however - aiming as it is to not be a Linux specific spec - requires that phandles be encoded in a property named simply "phandle". This patch adds support for this newer approach to dtc and libfdt. Specifically: - fdt_get_phandle() will now return the correct phandle if it is supplied in either of these properties - fdt_node_offset_by_phandle() will correctly find a node with the given phandle encoded in either property. - By default, when auto-generating phandles, dtc will encode it into both properties for maximum compatibility. A new -H option allows either only old-style or only new-style properties to be generated. - If phandle properties are explicitly supplied in the dts file, dtc will not auto-generate ones in the alternate format. - If both properties are supplied, dtc will check that they have the same value. - Some existing testcases are updated to use a mix of old and new-style phandles, partially testing the changes. - A new phandle_format test further tests the libfdt support, and the -H option. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-11-17dtc: Handle linux,phandle properties which self-referenceDavid Gibson1-0/+18
Currently, dtc will generate phandles for nodes which are referenced elsewhere in the tree. phandles can also be explicitly assigned by defining the linux,phandle property. However, there is no way, currently to tell dtc to generate a phandle for a node if it is not referenced elsewhere. This is inconvenient when it's expected that later processing on the flat tree might add nodes which _will_ the node in question. One way one might attempt to do this is with the construct: mynode: mynode { linux,phandle = <&mynode>; /* ... */ }; Though it's a trifle odd, there's really only one sensible meaning which can be assigned to this construct: allocate a unique phandle to "mynode" and put that in its linux,phandle property (as always). Currently, however, dtc will choke on this self-reference. This patch corrects this, making the construct above give the expected results. It also ensures a more meaningful error message is given if you attempt to process the nonsensical construct: mynode: mynode { linux,phandle = <&someothernode>; /* ... */ }; The 'references' testcase is extended to cover this case, as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14dtc: Run relevant checks on dtb input as well as dtsDavid Gibson1-7/+9
This patch adjusts the testsuite to run most of the tests for the tree checking code on input in dtb form as well as dts form. Some checks which only make sense for dts input (like reference handling) are excluded, as are those which currently take dtb input because they rely on things which cannot be lexically constructed in a dts file. This shows up two small bugs in dtc, which are also corrected. First, the name_properties test which was is supposed to remove correctly formed 'name' properties (because they can be reconstructed from tne node name) was instead removing 'name' properties even if they weren't correct. Secondly, when using dtb or fs input, the runtime tree in dtc did not have the parent pointer initialized propertly because.built internally. The appropriate initialization is added to the add_child() function. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-07-14dtc: Use the same endian-conversion functions as libfdtDavid Gibson1-1/+1
Currently both libfdt and dtc define a set of endian conversion macros for accessing the device tree blob which is always big-endian. libfdt uses names like cpu_to_fdt32() and dtc uses names like cpu_to_be32 (as the Linux kernel). This patch switches dtc over to using the libfdt macros (including libfdt_env.h to supply them). This has a couple of small advantages: - Removes some code duplication - Will make conversion a bit easier if we ever need to produce little-endian device tree blobs. - dtc no longer needs to pull in netinet/in.h simply for the ntohs() and ntohl() functions Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-03-23dtc: Strip redundant "name" propertiesDavid Gibson1-2/+13
If an input device tree has "name" properties which are correct, then they are redundant (because they can be derived from the unit name). Therefore, extend the checking code for correctness of "name" properties to remove them if they are correct. dtc will still insert name properties in the output if that's of a sufficiently old version to require them. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-03-23dtc: Fix indentation of fixup_phandle_referencesDavid Gibson1-17/+17
Somehow the indentation of this function is messed up - 7 spaces instead of 1 tab (probably a bad copy paste from a patch file). This patch fixes it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2008-03-23dtc: Implement checks for the format of node and property namesDavid Gibson1-0/+37
This patch adds checks to the checking framework to verify that node and property names contain only legal characters, and in the case of node names there is at most one '@'. At present when coming from dts input, this is mostly already ensured by the grammer, however putting the check later means its easier to generate helpful error messages rather than just "syntax error". For dtb input, these checks replace the older similar check built into flattree.c. Testcases for the checks are also implemented. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2007-12-18dtc: Remove remaining old-style checksDavid Gibson1-214/+1
The remaining old-style tree checking code: check_root(), check_cpus() and check_memory() really aren't that useful. They mostly check for the presence of particular nodes and properties. That's inherently prone to false-positives, because we could be dealing with an artificial tree (like many of the testcases) or it could be expected that the missing properties are filled in by a bootloader or other agent. If any of these checks really turns out to be useful, we can reimplement them later in a better conceived way on top of the new checking infrastructure. For now, just get rid of them, removing the last vestiges of the old-style checking code (hoorah). Signed-off-by: David Gibson <david@gibson.dropbear.id.au>