summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUcan, Emre (ADITG/SW1) <eucan@de.adit-jv.com>2016-03-16 13:37:02 +0000
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2016-03-17 13:31:18 +0200
commit10942379d295af1f02513daebd5e81a82641dd3f (patch)
treef1884e9460275236c99a6f2e7badde1f91da55d9
parent536d8335153a1cb0d8a6613d68e91ad49d605655 (diff)
ivi-shell: simplify ivi_layout_layer_add_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>
-rw-r--r--ivi-shell/ivi-layout.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 9c4d1622..f2ba15de 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2184,10 +2184,6 @@ static int32_t
ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer,
struct ivi_layout_surface *addsurf)
{
- struct ivi_layout *layout = get_instance();
- struct ivi_layout_surface *ivisurf = NULL;
- struct ivi_layout_surface *next = NULL;
-
if (ivilayer == NULL || addsurf == NULL) {
weston_log("ivi_layout_layer_add_surface: invalid argument\n");
return IVI_FAILED;
@@ -2196,14 +2192,8 @@ ivi_layout_layer_add_surface(struct ivi_layout_layer *ivilayer,
if (addsurf->on_layer == ivilayer)
return IVI_SUCCEEDED;
- wl_list_for_each_safe(ivisurf, next, &layout->surface_list, link) {
- if (ivisurf->id_surface == addsurf->id_surface) {
- wl_list_remove(&ivisurf->pending.link);
- wl_list_insert(&ivilayer->pending.surface_list,
- &ivisurf->pending.link);
- break;
- }
- }
+ wl_list_remove(&addsurf->pending.link);
+ wl_list_insert(&ivilayer->pending.surface_list, &addsurf->pending.link);
ivilayer->order.dirty = 1;