ivi-shell: simplify surface creation

The weston_surface passed to surface_create() should never be NULL. And other
code already relies on that anyway, so just remove the check.

Now surface_create() will never fail, so more checks can be removed.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2023-02-06 16:43:05 +01:00
parent c4fab1633b
commit 2c96bdbdbf
2 changed files with 2 additions and 12 deletions

View File

@ -1956,11 +1956,6 @@ surface_create(struct weston_surface *wl_surface, uint32_t id_surface)
struct ivi_layout *layout = get_instance();
struct ivi_layout_surface *ivisurf = NULL;
if (wl_surface == NULL) {
weston_log("ivi_layout_surface_create: invalid argument\n");
return NULL;
}
ivisurf = xzalloc(sizeof *ivisurf);
wl_signal_init(&ivisurf->property_changed);
@ -2003,10 +1998,8 @@ ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
ivisurf = surface_create(wl_surface, IVI_INVALID_ID);
if (ivisurf) {
ivisurf->weston_desktop_surface = surface;
wl_signal_emit(&layout->surface_notification.created, ivisurf);
}
ivisurf->weston_desktop_surface = surface;
wl_signal_emit(&layout->surface_notification.created, ivisurf);
return ivisurf;
}

View File

@ -519,9 +519,6 @@ desktop_surface_added(struct weston_desktop_surface *surface,
weston_desktop_surface_get_surface(surface);
layout_surface = ivi_layout_desktop_surface_create(weston_surf, surface);
if (!layout_surface) {
return;
}
ivisurf = xzalloc(sizeof *ivisurf);