diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2014-01-15 13:42:18 -0800 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-01-19 22:04:27 -0800 |
commit | 6d6d190b30b700b7867b46332d055f0e7a91c3ae (patch) | |
tree | b2dbcfdbebd7d557f9420d335481262c83a162b2 /desktop-shell/exposay.c | |
parent | bae79ca741cffa611bcfd8ec5405868781326720 (diff) |
exposay: remove redundant NULL check in highlight_surface
exposay_highlight_surface() is called from exposay_pick(),
exposay_layout(), and exposay_maybe_move() where the esurface
parameter is already validated prior to the call. This makes
the 'esurface' NULL check redundant. This assumes any future
calls to exposay_highlight_surface() will also validate the
'esurface' parameter prior to the call.
This fixes the logic in exposay_highlight_surface so static
analyzers don't complain about the possibility that 'view'
might be NULL deref'd when a 'esurface' == NULL condition is
true.
Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Diffstat (limited to 'desktop-shell/exposay.c')
-rw-r--r-- | desktop-shell/exposay.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c index 01bf0b13..fe7a3a71 100644 --- a/desktop-shell/exposay.c +++ b/desktop-shell/exposay.c @@ -136,13 +136,10 @@ static void exposay_highlight_surface(struct desktop_shell *shell, struct exposay_surface *esurface) { - struct weston_view *view = NULL; + struct weston_view *view = esurface->view; - if (esurface) { - shell->exposay.row_current = esurface->row; - shell->exposay.column_current = esurface->column; - view = esurface->view; - } + shell->exposay.row_current = esurface->row; + shell->exposay.column_current = esurface->column; activate(shell, view->surface, shell->exposay.seat); shell->exposay.focus_current = view; |