diff options
author | Frank Rowand <frank.rowand@sony.com> | 2018-03-08 17:39:05 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2018-03-12 11:27:49 -0400 |
commit | 54587be4962eb60645a7c4fccaa42c0793bf7a6a (patch) | |
tree | 984118fbab046f681aff6854159de191c4abea4a /drivers/of/unittest.c | |
parent | 06c4697894992b0977f1f4f079ba50da5eccf76a (diff) |
of: unittest: local return value variable related cleanups
Several more style issues became apparent while creating
"of: unittest: remove unneeded local return value variables".
Correct those issues.
Signed-off-by: Frank Rowand <frank.rowand@sony.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r-- | drivers/of/unittest.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index d1dc5cd5a58e..070caefb3b39 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c | |||
@@ -1416,7 +1416,6 @@ static void of_unittest_destroy_tracked_overlays(void) | |||
1416 | static int __init of_unittest_apply_overlay(int overlay_nr, int unittest_nr, | 1416 | static int __init of_unittest_apply_overlay(int overlay_nr, int unittest_nr, |
1417 | int *overlay_id) | 1417 | int *overlay_id) |
1418 | { | 1418 | { |
1419 | struct device_node *np = NULL; | ||
1420 | const char *overlay_name; | 1419 | const char *overlay_name; |
1421 | int ret; | 1420 | int ret; |
1422 | 1421 | ||
@@ -1426,16 +1425,11 @@ static int __init of_unittest_apply_overlay(int overlay_nr, int unittest_nr, | |||
1426 | if (!ret) { | 1425 | if (!ret) { |
1427 | unittest(0, "could not apply overlay \"%s\"\n", | 1426 | unittest(0, "could not apply overlay \"%s\"\n", |
1428 | overlay_name); | 1427 | overlay_name); |
1429 | goto out; | 1428 | return ret; |
1430 | } | 1429 | } |
1431 | of_unittest_track_overlay(*overlay_id); | 1430 | of_unittest_track_overlay(*overlay_id); |
1432 | 1431 | ||
1433 | ret = 0; | 1432 | return 0; |
1434 | |||
1435 | out: | ||
1436 | of_node_put(np); | ||
1437 | |||
1438 | return ret; | ||
1439 | } | 1433 | } |
1440 | 1434 | ||
1441 | /* apply an overlay while checking before and after states */ | 1435 | /* apply an overlay while checking before and after states */ |
@@ -1730,8 +1724,8 @@ static void __init of_unittest_overlay_10(void) | |||
1730 | 1724 | ||
1731 | ret = of_path_device_type_exists(child_path, PDEV_OVERLAY); | 1725 | ret = of_path_device_type_exists(child_path, PDEV_OVERLAY); |
1732 | kfree(child_path); | 1726 | kfree(child_path); |
1733 | if (unittest(ret, "overlay test %d failed; no child device\n", 10)) | 1727 | |
1734 | return; | 1728 | unittest(ret, "overlay test %d failed; no child device\n", 10); |
1735 | } | 1729 | } |
1736 | 1730 | ||
1737 | /* test insertion of a bus with parent devices (and revert) */ | 1731 | /* test insertion of a bus with parent devices (and revert) */ |
@@ -1742,9 +1736,7 @@ static void __init of_unittest_overlay_11(void) | |||
1742 | /* device should disable */ | 1736 | /* device should disable */ |
1743 | ret = of_unittest_apply_revert_overlay_check(11, 11, 0, 1, | 1737 | ret = of_unittest_apply_revert_overlay_check(11, 11, 0, 1, |
1744 | PDEV_OVERLAY); | 1738 | PDEV_OVERLAY); |
1745 | if (unittest(ret == 0, | 1739 | unittest(ret == 0, "overlay test %d failed; overlay apply\n", 11); |
1746 | "overlay test %d failed; overlay application\n", 11)) | ||
1747 | return; | ||
1748 | } | 1740 | } |
1749 | 1741 | ||
1750 | #if IS_BUILTIN(CONFIG_I2C) && IS_ENABLED(CONFIG_OF_OVERLAY) | 1742 | #if IS_BUILTIN(CONFIG_I2C) && IS_ENABLED(CONFIG_OF_OVERLAY) |
@@ -2268,10 +2260,8 @@ static int __init overlay_data_apply(const char *overlay_name, int *overlay_id) | |||
2268 | } | 2260 | } |
2269 | 2261 | ||
2270 | size = info->dtb_end - info->dtb_begin; | 2262 | size = info->dtb_end - info->dtb_begin; |
2271 | if (!size) { | 2263 | if (!size) |
2272 | pr_err("no overlay data for %s\n", overlay_name); | 2264 | pr_err("no overlay data for %s\n", overlay_name); |
2273 | ret = 0; | ||
2274 | } | ||
2275 | 2265 | ||
2276 | ret = of_overlay_fdt_apply(info->dtb_begin, size, &info->overlay_id); | 2266 | ret = of_overlay_fdt_apply(info->dtb_begin, size, &info->overlay_id); |
2277 | if (overlay_id) | 2267 | if (overlay_id) |