nv50,nvc0: make use of unreachable() when invalid texture target happens
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 14 Dec 2015 16:51:57 +0000 (17:51 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 14 Dec 2015 18:08:25 +0000 (19:08 +0100)
Spotted by Coverity.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv50/nv50_tex.c
src/gallium/drivers/nouveau/nvc0/nvc0_tex.c

index 6083ea995c82c709929d1f7293314dcfde25daf5..c3f433608df9bec726793eeaaa8600375d71c81d 100644 (file)
@@ -192,8 +192,7 @@ nv50_create_texture_view(struct pipe_context *pipe,
       tic[2] |= NV50_TIC_2_TARGET_BUFFER | NV50_TIC_2_LINEAR;
       break;
    default:
-      NOUVEAU_ERR("invalid texture target: %d\n", mt->base.base.target);
-      return false;
+      unreachable("unexpected/invalid texture target");
    }
 
    tic[3] = (flags & NV50_TEXVIEW_FILTER_MSAA8) ? 0x20000000 : 0x00300000;
index 2dd100ffdc7f6b12a54f88bc268fab14112baf28..74090ce40a5a87e264b12831a9ed28aaa237b1cc 100644 (file)
@@ -193,9 +193,7 @@ nvc0_create_texture_view(struct pipe_context *pipe,
       tic[2] |= NV50_TIC_2_TARGET_CUBE_ARRAY;
       break;
    default:
-      NOUVEAU_ERR("unexpected/invalid texture target: %d\n",
-                  mt->base.base.target);
-      return false;
+      unreachable("unexpected/invalid texture target");
    }
 
    tic[3] = (flags & NV50_TEXVIEW_FILTER_MSAA8) ? 0x20000000 : 0x00300000;