From f7609553a926881786f6ca4f60ba8d5ad6b5b152 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Tue, 7 Feb 2023 10:23:03 +0100 Subject: [PATCH] ivi-shell: remove some unnecessary checks Both functions are callbacks that are added when the ivi_shell_surface is created and removed when it is destroyed, so get_ivi_shell_surface() will never return NULL here. Signed-off-by: Michael Olbrich --- ivi-shell/ivi-shell.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 4a56584e..3dc7337a 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -121,10 +121,6 @@ ivi_shell_surface_committed(struct weston_surface *surface, { struct ivi_shell_surface *ivisurf = get_ivi_shell_surface(surface); - assert(ivisurf); - if (!ivisurf) - return; - if (surface->width == 0 || surface->height == 0) return; @@ -145,9 +141,6 @@ ivi_shell_surface_get_label(struct weston_surface *surface, { struct ivi_shell_surface *shell_surf = get_ivi_shell_surface(surface); - if (!shell_surf) - return snprintf(buf, len, "unidentified window in ivi-shell"); - return snprintf(buf, len, "ivi-surface %#x", shell_surf->id_surface); }