From: Edward O'Callaghan Date: Fri, 4 Dec 2015 09:08:09 +0000 (+1100) Subject: gallium: Remove redundant NULL ptr checks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d108b69d2cd4c54cc5eaa9ef5d75604d57b5187f;p=mesa.git gallium: Remove redundant NULL ptr checks Signed-off-by: Edward O'Callaghan Signed-off-by: Marek Olšák --- diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 337fb0fadda..877db5979b1 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -793,8 +793,7 @@ draw_aaline_stage(struct draw_context *draw) return aaline; fail: - if (aaline) - aaline->stage.destroy(&aaline->stage); + aaline->stage.destroy(&aaline->stage); return NULL; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 8e9bd960d2d..3d3a7aba7fb 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -259,12 +259,10 @@ pb_debug_buffer_map(struct pb_buffer *_buf, if (!map) return NULL; - if (map) { - pipe_mutex_lock(buf->mutex); - ++buf->map_count; - debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE); - pipe_mutex_unlock(buf->mutex); - } + pipe_mutex_lock(buf->mutex); + ++buf->map_count; + debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE); + pipe_mutex_unlock(buf->mutex); return (uint8_t *)map + buf->underflow_size; }