[Mesa-dev] [PATCH] gallium: Remove redundant NULL ptr checks
Marek Olšák
maraeo at gmail.com
Sun Dec 6 03:04:36 PST 2015
This doesn't apply, because master has "if(map)", but your patch has "if (map)".
Marek
On Sun, Dec 6, 2015 at 6:00 AM, Edward O'Callaghan
<eocallaghan at alterapraxis.com> wrote:
> Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
> ---
> src/gallium/auxiliary/draw/draw_pipe_aaline.c | 3 +--
> src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c | 10 ++++------
> 2 files changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
> index 337fb0f..877db59 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 8e9bd96..3d3a7ab 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;
> }
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list