[PATCH weston 4/5] ivi-shell: simplify ivi_layout_screen_add_layer

Ucan, Emre (ADITG/SW1) eucan at de.adit-jv.com
Wed Mar 16 13:37:07 UTC 2016


Signed-off-by: Emre Ucan <eucan at de.adit-jv.com>
---
 ivi-shell/ivi-layout.c |   14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 2782346..33e393e 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2019,10 +2019,6 @@ static int32_t
 ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn,
 			    struct ivi_layout_layer *addlayer)
 {
-	struct ivi_layout *layout = get_instance();
-	struct ivi_layout_layer *ivilayer = NULL;
-	struct ivi_layout_layer *next = NULL;
-
 	if (iviscrn == NULL || addlayer == NULL) {
 		weston_log("ivi_layout_screen_add_layer: invalid argument\n");
 		return IVI_FAILED;
@@ -2033,14 +2029,8 @@ ivi_layout_screen_add_layer(struct ivi_layout_screen *iviscrn,
 		return IVI_SUCCEEDED;
 	}
 
-	wl_list_for_each_safe(ivilayer, next, &layout->layer_list, link) {
-		if (ivilayer->id_layer == addlayer->id_layer) {
-			wl_list_remove(&ivilayer->pending.link);
-			wl_list_insert(&iviscrn->pending.layer_list,
-				       &ivilayer->pending.link);
-			break;
-		}
-	}
+	wl_list_remove(&addlayer->pending.link);
+	wl_list_insert(&iviscrn->pending.layer_list, &addlayer->pending.link);
 
 	iviscrn->order.dirty = 1;
 
-- 
1.7.9.5



More information about the wayland-devel mailing list