[PATCH weston 1/5] ivi-shell: simplify ivi_layout_remove_surface

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


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

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 77578d4..d004e25 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2219,22 +2219,13 @@ static void
 ivi_layout_layer_remove_surface(struct ivi_layout_layer *ivilayer,
 				struct ivi_layout_surface *remsurf)
 {
-	struct ivi_layout_surface *ivisurf = NULL;
-	struct ivi_layout_surface *next = NULL;
-
 	if (ivilayer == NULL || remsurf == NULL) {
 		weston_log("ivi_layout_layer_remove_surface: invalid argument\n");
 		return;
 	}
 
-	wl_list_for_each_safe(ivisurf, next,
-			      &ivilayer->pending.surface_list, pending.link) {
-		if (ivisurf->id_surface == remsurf->id_surface) {
-			wl_list_remove(&ivisurf->pending.link);
-			wl_list_init(&ivisurf->pending.link);
-			break;
-		}
-	}
+	wl_list_remove(&remsurf->pending.link);
+	wl_list_init(&remsurf->pending.link);
 
 	ivilayer->order.dirty = 1;
 }
-- 
1.7.9.5



More information about the wayland-devel mailing list