[Mesa-dev] [PATCH 1/2] gallium/util: fix coverity MIXED_ENUMS warning

Rob Clark robdclark at gmail.com
Sun May 29 16:32:24 UTC 2016


From: Rob Clark <robclark at freedesktop.org>

CID 1362171, 1362170

Looks like it should be pipe_transfer_usage in the prototype, based on
how the parameter is used.  Note that I don't see any users of u_staging
so maybe we should just remove it?

Signed-off-by: Rob Clark <robclark at freedesktop.org>
---
 src/gallium/auxiliary/util/u_staging.c | 2 +-
 src/gallium/auxiliary/util/u_staging.h | 7 +------
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_staging.c b/src/gallium/auxiliary/util/u_staging.c
index 5b61f5e..b393ae6 100644
--- a/src/gallium/auxiliary/util/u_staging.c
+++ b/src/gallium/auxiliary/util/u_staging.c
@@ -56,7 +56,7 @@ util_staging_resource_template(struct pipe_resource *pt, unsigned width,
 struct util_staging_transfer *
 util_staging_transfer_init(struct pipe_context *pipe,
                            struct pipe_resource *pt,
-                           unsigned level, enum pipe_resource_usage usage,
+                           unsigned level, enum pipe_transfer_usage usage,
                            const struct pipe_box *box,
                            boolean direct, struct util_staging_transfer *tx)
 {
diff --git a/src/gallium/auxiliary/util/u_staging.h b/src/gallium/auxiliary/util/u_staging.h
index eed5584..dc3b048 100644
--- a/src/gallium/auxiliary/util/u_staging.h
+++ b/src/gallium/auxiliary/util/u_staging.h
@@ -48,15 +48,10 @@ struct util_staging_transfer {
    struct pipe_resource *staging_resource;
 };
 
-/* user must be stride, slice_stride and offset.
- * pt->usage == PIPE_USAGE_DYNAMIC || pt->usage == PIPE_USAGE_STAGING
- * should be a good value to pass for direct staging resource is currently
- * created with PIPE_USAGE_STAGING
- */
 struct util_staging_transfer *
 util_staging_transfer_init(struct pipe_context *pipe,
                            struct pipe_resource *pt,
-                           unsigned level, enum pipe_resource_usage usage,
+                           unsigned level, enum pipe_transfer_usage usage,
                            const struct pipe_box *box,
                            boolean direct, struct util_staging_transfer *tx);
 
-- 
2.5.5



More information about the mesa-dev mailing list