From ed56edc7bad631e7be8f3e68151ebd0f1b7576fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 20 May 2019 21:28:04 +0200 Subject: [PATCH] drm-buffer: Remove useless soft-asserts If triggered, many would result in crashes later anyway, so lets change those to asserts. Some are simply useless, so remove those. https://gitlab.gnome.org/GNOME/mutter/merge_requests/584 --- src/backends/native/meta-drm-buffer.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/backends/native/meta-drm-buffer.c b/src/backends/native/meta-drm-buffer.c index 298f2cba7..4414cce34 100644 --- a/src/backends/native/meta-drm-buffer.c +++ b/src/backends/native/meta-drm-buffer.c @@ -80,12 +80,10 @@ meta_drm_buffer_acquire_swapped_buffer (MetaDrmBuffer *buffer, int i; int kms_fd; - g_return_val_if_fail (META_IS_DRM_BUFFER (buffer), FALSE); - g_return_val_if_fail (buffer->type == META_DRM_BUFFER_TYPE_GBM, FALSE); - g_return_val_if_fail (buffer->gbm.bo == NULL, FALSE); - g_return_val_if_fail (buffer->gbm.surface != NULL, FALSE); - g_return_val_if_fail (buffer->gbm.gpu_kms != NULL, FALSE); - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + g_assert (buffer->type == META_DRM_BUFFER_TYPE_GBM); + g_assert (!buffer->gbm.bo); + g_assert (buffer->gbm.surface); + g_assert (buffer->gbm.gpu_kms); kms_fd = meta_gpu_kms_get_fd (buffer->gbm.gpu_kms); @@ -238,9 +236,6 @@ meta_drm_buffer_new_from_gbm (MetaGpuKms *gpu_kms, { MetaDrmBuffer *buffer; - g_return_val_if_fail (META_IS_GPU_KMS (gpu_kms), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - buffer = g_object_new (META_TYPE_DRM_BUFFER, NULL); buffer->type = META_DRM_BUFFER_TYPE_GBM; buffer->gbm.gpu_kms = gpu_kms; @@ -272,15 +267,12 @@ meta_drm_buffer_new_from_dumb (uint32_t dumb_fb_id) uint32_t meta_drm_buffer_get_fb_id (const MetaDrmBuffer *buffer) { - g_return_val_if_fail (buffer != NULL, INVALID_FB_ID); - return buffer->fb_id; } struct gbm_bo * meta_drm_buffer_get_bo (const MetaDrmBuffer *buffer) { - g_return_val_if_fail (buffer, NULL); g_return_val_if_fail (buffer->type == META_DRM_BUFFER_TYPE_GBM, NULL); return buffer->gbm.bo;