diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2017-11-28 03:26:33 -0500 |
---|---|---|
committer | Rob Herring <robh@kernel.org> | 2017-12-06 15:56:33 -0500 |
commit | 6de67de326041c3a450a117b2733cbedd3aab097 (patch) | |
tree | aeab0884f7d1b6d56cebc73f40f75a67179a7daf | |
parent | e9d92e40ac9dea5a9a185fc11227f492f0b74fc7 (diff) |
of: overlay: Remove else after goto
If an "if" branch is terminated by a "goto", there's no need to have an
"else" statement and an indented block of code.
Remove the "else" statement to simplify the code flow for the casual
reviewer.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
-rw-r--r-- | drivers/of/overlay.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index 3036f1776efc..2b852a39581e 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c | |||
@@ -580,9 +580,9 @@ static int init_overlay_changeset(struct overlay_changeset *ovcs, | |||
580 | of_node_put(fragment->overlay); | 580 | of_node_put(fragment->overlay); |
581 | ret = -EINVAL; | 581 | ret = -EINVAL; |
582 | goto err_free_fragments; | 582 | goto err_free_fragments; |
583 | } else { | ||
584 | cnt++; | ||
585 | } | 583 | } |
584 | |||
585 | cnt++; | ||
586 | } | 586 | } |
587 | } | 587 | } |
588 | 588 | ||
@@ -736,14 +736,13 @@ int of_overlay_apply(struct device_node *tree, int *ovcs_id) | |||
736 | devicetree_state_flags |= DTSF_APPLY_FAIL; | 736 | devicetree_state_flags |= DTSF_APPLY_FAIL; |
737 | } | 737 | } |
738 | goto err_free_overlay_changeset; | 738 | goto err_free_overlay_changeset; |
739 | } else { | ||
740 | ret = __of_changeset_apply_notify(&ovcs->cset); | ||
741 | if (ret) | ||
742 | pr_err("overlay changeset entry notify error %d\n", | ||
743 | ret); | ||
744 | /* fall through */ | ||
745 | } | 739 | } |
746 | 740 | ||
741 | ret = __of_changeset_apply_notify(&ovcs->cset); | ||
742 | if (ret) | ||
743 | pr_err("overlay changeset entry notify error %d\n", ret); | ||
744 | /* notify failure is not fatal, continue */ | ||
745 | |||
747 | list_add_tail(&ovcs->ovcs_list, &ovcs_list); | 746 | list_add_tail(&ovcs->ovcs_list, &ovcs_list); |
748 | *ovcs_id = ovcs->id; | 747 | *ovcs_id = ovcs->id; |
749 | 748 | ||
@@ -931,15 +930,13 @@ int of_overlay_remove(int *ovcs_id) | |||
931 | if (ret_apply) | 930 | if (ret_apply) |
932 | devicetree_state_flags |= DTSF_REVERT_FAIL; | 931 | devicetree_state_flags |= DTSF_REVERT_FAIL; |
933 | goto out_unlock; | 932 | goto out_unlock; |
934 | } else { | ||
935 | ret = __of_changeset_revert_notify(&ovcs->cset); | ||
936 | if (ret) { | ||
937 | pr_err("overlay changeset entry notify error %d\n", | ||
938 | ret); | ||
939 | /* fall through - changeset was reverted */ | ||
940 | } | ||
941 | } | 933 | } |
942 | 934 | ||
935 | ret = __of_changeset_revert_notify(&ovcs->cset); | ||
936 | if (ret) | ||
937 | pr_err("overlay changeset entry notify error %d\n", ret); | ||
938 | /* notify failure is not fatal, continue */ | ||
939 | |||
943 | *ovcs_id = 0; | 940 | *ovcs_id = 0; |
944 | 941 | ||
945 | ret_tmp = overlay_notify(ovcs, OF_OVERLAY_POST_REMOVE); | 942 | ret_tmp = overlay_notify(ovcs, OF_OVERLAY_POST_REMOVE); |