shm: remove wl_shm_buffer.pool NULL checks

wl_shm_buffer.pool is never set to NULL. The only time it's set is
in shm_pool_create_buffer, and the pool is guaranteed to be non-NULL
there.

Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
Simon Ser 2021-06-02 16:22:54 +02:00
parent abcf1048e2
commit ba0c63dee8

View file

@ -124,8 +124,7 @@ destroy_buffer(struct wl_resource *resource)
{
struct wl_shm_buffer *buffer = wl_resource_get_user_data(resource);
if (buffer->pool)
shm_pool_unref(buffer->pool, false);
shm_pool_unref(buffer->pool, false);
free(buffer);
}
@ -400,11 +399,6 @@ wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer)
WL_EXPORT void *
wl_shm_buffer_get_data(struct wl_shm_buffer *buffer)
{
assert(buffer->pool);
if (!buffer->pool)
return NULL;
if (buffer->pool->external_refcount &&
(buffer->pool->size != buffer->pool->new_size))
wl_log("Buffer address requested when its parent pool "