summaryrefslogtreecommitdiff
path: root/ivi-shell
diff options
context:
space:
mode:
authorUcan, Emre (ADITG/SW1) <eucan@de.adit-jv.com>2016-03-16 13:36:59 +0000
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-03-17 13:31:00 +0200
commit536d8335153a1cb0d8a6613d68e91ad49d605655 (patch)
tree2316e71dbddd05b60e7cbce0335222a13e58fd6f /ivi-shell
parent5cbf1e8146ad02c57a27576557b26133caea5413 (diff)
downloadweston-536d8335153a1cb0d8a6613d68e91ad49d605655.tar.gz
ivi-shell: simplify ivi_layout_remove_surface
It is not necessary check the ivi-id of pregiven objects (layer or surface). Traversing the list of all objects is sure to find the exact same pointer we start with, bugs aside. The controller modules are responsible for providing valid pointers. We cannot protect from invalid pointers anyway. Signed-off-by: Emre Ucan <eucan@de.adit-jv.com> [Pekka: commit message] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Diffstat (limited to 'ivi-shell')
-rw-r--r--ivi-shell/ivi-layout.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 390617c6..9c4d1622 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2214,22 +2214,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;
}