diff options
author | Edward O'Callaghan <[email protected]> | 2015-12-04 17:12:30 +1100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-12-06 17:10:22 +0100 |
commit | 147fd00bb36917f8463aacd49a26e95ca0926255 (patch) | |
tree | 377b6ed379b13754e2f18bf392a3b84c6babcf01 /src/gallium/auxiliary/pipebuffer | |
parent | 25b3d554c4403b3b63f58cea6f0fc0cf3232a1c0 (diff) |
gallium/auxiliary: Trivial code style cleanup
Signed-off-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/pipebuffer')
11 files changed, 34 insertions, 34 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index ba48d461d5c..803c1d39192 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -163,7 +163,7 @@ pb_map(struct pb_buffer *buf, unsigned flags, void *flush_ctx) { assert(buf); - if(!buf) + if (!buf) return NULL; assert(pipe_is_referenced(&buf->reference)); return buf->vtbl->map(buf, flags, flush_ctx); @@ -174,7 +174,7 @@ static inline void pb_unmap(struct pb_buffer *buf) { assert(buf); - if(!buf) + if (!buf) return; assert(pipe_is_referenced(&buf->reference)); buf->vtbl->unmap(buf); @@ -187,7 +187,7 @@ pb_get_base_buffer( struct pb_buffer *buf, pb_size *offset ) { assert(buf); - if(!buf) { + if (!buf) { base_buf = NULL; offset = 0; return; @@ -204,7 +204,7 @@ static inline enum pipe_error pb_validate(struct pb_buffer *buf, struct pb_validate *vl, unsigned flags) { assert(buf); - if(!buf) + if (!buf) return PIPE_ERROR; assert(buf->vtbl->validate); return buf->vtbl->validate(buf, vl, flags); @@ -215,7 +215,7 @@ static inline void pb_fence(struct pb_buffer *buf, struct pipe_fence_handle *fence) { assert(buf); - if(!buf) + if (!buf) return; assert(buf->vtbl->fence); buf->vtbl->fence(buf, fence); @@ -226,7 +226,7 @@ static inline void pb_destroy(struct pb_buffer *buf) { assert(buf); - if(!buf) + if (!buf) return; assert(!pipe_is_referenced(&buf->reference)); buf->vtbl->destroy(buf); diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 08935b4dec7..2678268e923 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -626,7 +626,7 @@ fenced_buffer_copy_storage_to_gpu_locked(struct fenced_buffer *fenced_buf) assert(fenced_buf->buffer); map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_WRITE, NULL); - if(!map) + if (!map) return PIPE_ERROR; memcpy(map, fenced_buf->data, fenced_buf->size); @@ -646,7 +646,7 @@ fenced_buffer_copy_storage_to_cpu_locked(struct fenced_buffer *fenced_buf) assert(fenced_buf->buffer); map = pb_map(fenced_buf->buffer, PB_USAGE_CPU_READ, NULL); - if(!map) + if (!map) return PIPE_ERROR; memcpy(fenced_buf->data, map, fenced_buf->size); @@ -720,7 +720,7 @@ fenced_buffer_map(struct pb_buffer *buf, map = fenced_buf->data; } - if(map) { + if (map) { ++fenced_buf->mapcount; fenced_buf->flags |= flags & PB_USAGE_CPU_READ_WRITE; } @@ -764,7 +764,7 @@ fenced_buffer_validate(struct pb_buffer *buf, pipe_mutex_lock(fenced_mgr->mutex); - if(!vl) { + if (!vl) { /* invalidate */ fenced_buf->vl = NULL; fenced_buf->validation_flags = 0; @@ -927,7 +927,7 @@ fenced_bufmgr_create_buffer(struct pb_manager *mgr, } fenced_buf = CALLOC_STRUCT(fenced_buffer); - if(!fenced_buf) + if (!fenced_buf) goto no_buffer; pipe_reference_init(&fenced_buf->base.reference, 1); @@ -1042,7 +1042,7 @@ fenced_bufmgr_create(struct pb_manager *provider, { struct fenced_manager *fenced_mgr; - if(!provider) + if (!provider) return NULL; fenced_mgr = CALLOC_STRUCT(fenced_manager); diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c index b97771457d6..ea2f2fa107c 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_malloc.c @@ -132,7 +132,7 @@ pb_malloc_buffer_create(pb_size size, /* TODO: do a single allocation */ buf = CALLOC_STRUCT(malloc_buffer); - if(!buf) + if (!buf) return NULL; pipe_reference_init(&buf->base.reference, 1); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c index 47cbaeb20ac..f71bacc8820 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_alt.c @@ -67,7 +67,7 @@ pb_alt_manager_create_buffer(struct pb_manager *_mgr, struct pb_buffer *buf; buf = mgr->provider1->create_buffer(mgr->provider1, size, desc); - if(buf) + if (buf) return buf; buf = mgr->provider2->create_buffer(mgr->provider2, size, desc); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index cc8ae84bb1b..1c8c25d6f76 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -354,7 +354,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, } } - if(buf) { + if (buf) { mgr->cache_size -= buf->base.size; LIST_DEL(&buf->head); --mgr->numDelayed; @@ -367,7 +367,7 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, pipe_mutex_unlock(mgr->mutex); buf = CALLOC_STRUCT(pb_cache_buffer); - if(!buf) + if (!buf) return NULL; buf->buffer = mgr->provider->create_buffer(mgr->provider, size, desc); @@ -454,7 +454,7 @@ pb_cache_manager_create(struct pb_manager *provider, { struct pb_cache_manager *mgr; - if(!provider) + if (!provider) return NULL; mgr = CALLOC_STRUCT(pb_cache_manager); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c index 7ad70f293a6..8e9bd960d2d 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_debug.c @@ -160,7 +160,7 @@ pb_debug_buffer_fill(struct pb_debug_buffer *buf) map = pb_map(buf->buffer, PB_USAGE_CPU_WRITE, NULL); assert(map); - if(map) { + if (map) { fill_random_pattern(map, buf->underflow_size); fill_random_pattern(map + buf->underflow_size + buf->base.size, buf->overflow_size); @@ -183,7 +183,7 @@ pb_debug_buffer_check(struct pb_debug_buffer *buf) PB_USAGE_CPU_READ | PB_USAGE_UNSYNCHRONIZED, NULL); assert(map); - if(map) { + if (map) { boolean underflow, overflow; pb_size min_ofs, max_ofs; @@ -256,10 +256,10 @@ pb_debug_buffer_map(struct pb_buffer *_buf, pb_debug_buffer_check(buf); map = pb_map(buf->buffer, flags, flush_ctx); - if(!map) + if (!map) return NULL; - if(map) { + if (map) { pipe_mutex_lock(buf->mutex); ++buf->map_count; debug_backtrace_capture(buf->map_backtrace, 1, PB_DEBUG_MAP_BACKTRACE); @@ -375,7 +375,7 @@ pb_debug_manager_create_buffer(struct pb_manager *_mgr, assert(desc->alignment); buf = CALLOC_STRUCT(pb_debug_buffer); - if(!buf) + if (!buf) return NULL; real_size = mgr->underflow_size + size + mgr->overflow_size; @@ -462,7 +462,7 @@ pb_debug_manager_create(struct pb_manager *provider, { struct pb_debug_manager *mgr; - if(!provider) + if (!provider) return NULL; mgr = CALLOC_STRUCT(pb_debug_manager); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c index 72099ba5850..14de61b163f 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_mm.c @@ -252,7 +252,7 @@ mm_bufmgr_create_from_buffer(struct pb_buffer *buffer, { struct mm_pb_manager *mm; - if(!buffer) + if (!buffer) return NULL; mm = CALLOC_STRUCT(mm_pb_manager); @@ -300,7 +300,7 @@ mm_bufmgr_create(struct pb_manager *provider, struct pb_manager *mgr; struct pb_desc desc; - if(!provider) + if (!provider) return NULL; memset(&desc, 0, sizeof(desc)); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c index c20e2dca02d..4885d68c398 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_ondemand.c @@ -151,7 +151,7 @@ pb_ondemand_buffer_instantiate(struct pb_ondemand_buffer *buf) return PIPE_ERROR_OUT_OF_MEMORY; map = pb_map(buf->buffer, PB_USAGE_CPU_READ, NULL); - if(!map) { + if (!map) { pb_reference(&buf->buffer, NULL); return PIPE_ERROR; } @@ -241,7 +241,7 @@ pb_ondemand_manager_create_buffer(struct pb_manager *_mgr, struct pb_ondemand_buffer *buf; buf = CALLOC_STRUCT(pb_ondemand_buffer); - if(!buf) + if (!buf) return NULL; pipe_reference_init(&buf->base.reference, 1); @@ -288,11 +288,11 @@ pb_ondemand_manager_create(struct pb_manager *provider) { struct pb_ondemand_manager *mgr; - if(!provider) + if (!provider) return NULL; mgr = CALLOC_STRUCT(pb_ondemand_manager); - if(!mgr) + if (!mgr) return NULL; mgr->base.destroy = pb_ondemand_manager_destroy; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c index 56a5e82ece0..98877b46352 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_pool.c @@ -261,7 +261,7 @@ pool_bufmgr_create(struct pb_manager *provider, struct pool_buffer *pool_buf; pb_size i; - if(!provider) + if (!provider) return NULL; pool = CALLOC_STRUCT(pool_pb_manager); diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c index aadeaa087f4..fdbcf9e5c44 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_slab.c @@ -542,7 +542,7 @@ pb_slab_range_manager_create(struct pb_manager *provider, pb_size bufSize; unsigned i; - if(!provider) + if (!provider) return NULL; mgr = CALLOC_STRUCT(pb_slab_range_manager); diff --git a/src/gallium/auxiliary/pipebuffer/pb_validate.c b/src/gallium/auxiliary/pipebuffer/pb_validate.c index 657ac23ef25..8489842effd 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_validate.c +++ b/src/gallium/auxiliary/pipebuffer/pb_validate.c @@ -66,7 +66,7 @@ pb_validate_add_buffer(struct pb_validate *vl, unsigned flags) { assert(buf); - if(!buf) + if (!buf) return PIPE_ERROR; assert(flags & PB_USAGE_GPU_READ_WRITE); @@ -94,7 +94,7 @@ pb_validate_add_buffer(struct pb_validate *vl, new_entries = (struct pb_validate_entry *)REALLOC(vl->entries, vl->size*sizeof(struct pb_validate_entry), new_size*sizeof(struct pb_validate_entry)); - if(!new_entries) + if (!new_entries) return PIPE_ERROR_OUT_OF_MEMORY; memset(new_entries + vl->size, 0, (new_size - vl->size)*sizeof(struct pb_validate_entry)); @@ -177,7 +177,7 @@ pb_validate_create() struct pb_validate *vl; vl = CALLOC_STRUCT(pb_validate); - if(!vl) + if (!vl) return NULL; vl->size = PB_VALIDATE_INITIAL_SIZE; |