[Mesa-dev] [PATCH] gallium: fix clang warnings

Martina Kollarova martina.kollarova at intel.com
Tue Sep 6 14:37:57 UTC 2016


1. Variable 'hole' is uninitialized when used here [-Wuninitialized]
2. Comparison of constant -1 with expression of type 'unsigned int' is always
   false [-Wtautological-constant-out-of-range-compare]
---
 src/gallium/winsys/radeon/drm/radeon_drm_bo.c     | 2 +-
 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 56aab48..23ee8d5 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -200,7 +200,7 @@ static uint64_t radeon_bomgr_find_va(struct radeon_drm_winsys *rws,
 static void radeon_bomgr_free_va(struct radeon_drm_winsys *rws,
                                  uint64_t va, uint64_t size)
 {
-    struct radeon_bo_va_hole *hole;
+    struct radeon_bo_va_hole *hole = NULL;
 
     size = align(size, rws->info.gart_page_size);
 
diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index 07eca99..33f6850 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -259,11 +259,6 @@ kms_sw_displaytarget_add_from_prime(struct kms_sw_winsys *kms_sw, int fd,
    kms_sw_dt->height = height;
    kms_sw_dt->stride = stride;
 
-   if (kms_sw_dt->size == (off_t)-1) {
-      FREE(kms_sw_dt);
-      return NULL;
-   }
-
    lseek(fd, 0, SEEK_SET);
 
    list_add(&kms_sw_dt->link, &kms_sw->bo_list);
-- 
1.9.1



More information about the mesa-dev mailing list