{
struct compute_memory_pool* pool = (struct compute_memory_pool*)
CALLOC(sizeof(struct compute_memory_pool), 1);
- if (pool == NULL)
+ if (!pool)
return NULL;
COMPUTE_DBG(rscreen, "* compute_memory_pool_new()\n");
initial_size_in_dw);
pool->size_in_dw = initial_size_in_dw;
- pool->bo = (struct r600_resource*)r600_compute_buffer_alloc_vram(pool->screen,
- pool->size_in_dw * 4);
+ pool->bo = r600_compute_buffer_alloc_vram(pool->screen,
+ pool->size_in_dw * 4);
}
/**
} else {
struct r600_resource *temp = NULL;
- temp = (struct r600_resource *)r600_compute_buffer_alloc_vram(
- pool->screen, new_size_in_dw * 4);
+ temp = r600_compute_buffer_alloc_vram(pool->screen, new_size_in_dw * 4);
if (temp != NULL) {
struct pipe_resource *src = (struct pipe_resource *)pool->bo;
pool->screen->b.b.resource_destroy(
(struct pipe_screen *)pool->screen,
(struct pipe_resource *)pool->bo);
- pool->bo = (struct r600_resource*)r600_compute_buffer_alloc_vram(
- pool->screen,
- pool->size_in_dw * 4);
+ pool->bo = r600_compute_buffer_alloc_vram(pool->screen, pool->size_in_dw * 4);
compute_memory_shadow(pool, pipe, 0);
if (pool->status & POOL_FRAGMENTED) {
list_addtail(&item->link, pool->item_list);
item->start_in_dw = start_in_dw;
- if (src != NULL) {
+ if (src) {
u_box_1d(0, item->size_in_dw * 4, &box);
rctx->b.b.resource_copy_region(pipe,
/* We check if the intermediate buffer exists, and if it
* doesn't, we create it again */
if (item->real_buffer == NULL) {
- item->real_buffer = (struct r600_resource*)r600_compute_buffer_alloc_vram(
+ item->real_buffer = r600_compute_buffer_alloc_vram(
pool->screen, item->size_in_dw * 4);
}
struct r600_context *rctx = (struct r600_context *)pipe;
struct pipe_box box;
- struct compute_memory_item *prev;
+ MAYBE_UNUSED struct compute_memory_item *prev;
COMPUTE_DBG(pool->screen, "* compute_memory_move_item()\n"
" + Moving item %"PRIi64" from %"PRIi64" (%"PRIi64" bytes) to %"PRIu64" (%"PRIu64" bytes)\n",
new_item = (struct compute_memory_item *)
CALLOC(sizeof(struct compute_memory_item), 1);
- if (new_item == NULL)
+ if (!new_item)
return NULL;
new_item->size_in_dw = size_in_dw;