gallium: Remove redundant NULL ptr checks
authorEdward O'Callaghan <eocallaghan@alterapraxis.com>
Fri, 4 Dec 2015 09:08:09 +0000 (20:08 +1100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 6 Dec 2015 16:10:23 +0000 (17:10 +0100)
Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/auxiliary/draw/draw_pipe_aaline.c
src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c

index 337fb0fadda267ccf240973b43b8650adef40a37..877db5979b11b10489192ee3eeb786d84f5d0f7a 100644 (file)
@@ -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;
 }
index 8e9bd960d2d9f9bc65bbdeeed1c4a27967d943e3..3d3a7aba7fb0bd452a23aab1d96c8e5965c8e6ff 100644 (file)
@@ -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;
 }