virgl: only warn about unchecked flags
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 10 Apr 2019 10:18:33 +0000 (12:18 +0200)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Thu, 11 Apr 2019 07:53:15 +0000 (09:53 +0200)
The other flags are already vetted, so there's no point in reporting
them.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
src/gallium/drivers/virgl/virgl_texture.c

index 755b7686dd13697dd8d3495a0fbe71c7a9d1c1c7..c5226f21421c3ea4e4059c8241a696ed65f681f7 100644 (file)
@@ -63,9 +63,10 @@ static void virgl_copy_region_with_blit(struct pipe_context *pipe,
 
 static unsigned temp_bind(unsigned orig)
 {
-   if (orig & ~(PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL |
-                PIPE_BIND_SAMPLER_VIEW))
-      fprintf(stderr, "Waring, possibly unhandled bind: %x\n", orig);
+   unsigned warn = ~(PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL |
+                     PIPE_BIND_SAMPLER_VIEW);
+   if (orig & warn)
+      fprintf(stderr, "Waring, possibly unhandled bind: %x\n", orig & warn);
    return orig & (PIPE_BIND_DEPTH_STENCIL | PIPE_BIND_RENDER_TARGET);
 }