diff options
author | Frank Rowand <frank.rowand@sonymobile.com> | 2015-03-14 07:57:40 +0100 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2015-03-29 09:56:19 +0200 |
commit | 716e1d493a8717251158c708b2f161017bdcb3f9 (patch) | |
tree | 256768386603a92de19b93fccd16ea825e463f8a /drivers/of/unittest.c | |
parent | of/unittest: breadcrumbs to reduce pain of future maintainers (diff) | |
download | linux-716e1d493a8717251158c708b2f161017bdcb3f9.tar.xz linux-716e1d493a8717251158c708b2f161017bdcb3f9.zip |
of/unittest: early return from test skips tests
Fix bugs pointed out by checkpatch: Mis-coding of two if statements
caused early return from function.
Number of tests completed increased from 102 to 107.
Number of tests failed increased from 0 to 2.
Signed-off-by: Frank Rowand <frank.rowand@sonymobile.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r-- | drivers/of/unittest.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 9e4e401ff21d..3b155774dfee 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c @@ -782,12 +782,14 @@ static void __init of_selftest_platform_populate(void) irq = platform_get_irq(pdev, 0); selftest(irq < 0 && irq != -EPROBE_DEFER, "device parsing error failed - %d\n", irq); - if (selftest(np = of_find_node_by_path("/testcase-data/platform-tests"), - "No testcase data in device tree\n")); + np = of_find_node_by_path("/testcase-data/platform-tests"); + selftest(np, "No testcase data in device tree\n"); + if (!np) return; - if (selftest(!(rc = device_register(&test_bus)), - "testbus registration failed; rc=%i\n", rc)); + rc = device_register(&test_bus); + selftest(!rc, "testbus registration failed; rc=%i\n", rc); + if (rc) return; for_each_child_of_node(np, child) { |