panfrost: assert(0) -> unreachable for some switch

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index c4bb57d..635d0cf 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -438,8 +438,7 @@
                 return MALI_WRAP_MIRRORED_REPEAT;
 
         default:
-                assert(0);
-                return 0;
+                unreachable("Invalid wrap");
         }
 }
 
@@ -454,8 +453,7 @@
                 return MALI_LINEAR;
 
         default:
-                assert(0);
-                return 0;
+                unreachable("Invalid filter");
         }
 }
 
@@ -492,10 +490,10 @@
 
         case PIPE_FUNC_ALWAYS:
                 return MALI_FUNC_ALWAYS;
-        }
 
-        assert (0);
-        return 0; /* Unreachable */
+        default:
+                unreachable("Invalid func");
+        }
 }
 
 static unsigned
@@ -525,10 +523,10 @@
 
         case PIPE_FUNC_ALWAYS:
                 return MALI_ALT_FUNC_ALWAYS;
-        }
 
-        assert (0);
-        return 0; /* Unreachable */
+        default:
+                unreachable("Invalid alt func");
+        }
 }
 
 static unsigned
@@ -558,10 +556,10 @@
 
         case PIPE_STENCIL_OP_INVERT:
                 return MALI_STENCIL_INVERT;
-        }
 
-        assert (0);
-        return 0; /* Unreachable */
+        default:
+                unreachable("Invalid stencil op");
+        }
 }
 
 static void
@@ -1200,8 +1198,7 @@
                         break;
 
                 default:
-                        DBG("Unknown shader stage %d in uniform upload\n", i);
-                        assert(0);
+                        unreachable("Invalid shader stage\n");
                 }
 
                 /* Also attach the same buffer as a UBO for extended access */
@@ -1432,9 +1429,7 @@
                 DEFINE_CASE(POLYGON);
 
         default:
-                DBG("Illegal draw mode %d\n", mode);
-                assert(0);
-                return MALI_LINE_LOOP;
+                unreachable("Invalid draw mode");
         }
 }
 
@@ -1454,9 +1449,7 @@
                 return MALI_DRAW_INDEXED_UINT32;
 
         default:
-                DBG("Unknown index size %d\n", size);
-                assert(0);
-                return 0;
+                unreachable("Invalid index size");
         }
 }
 
diff --git a/src/gallium/drivers/panfrost/pan_format.c b/src/gallium/drivers/panfrost/pan_format.c
index a61d7b1..5f75a06 100644
--- a/src/gallium/drivers/panfrost/pan_format.c
+++ b/src/gallium/drivers/panfrost/pan_format.c
@@ -53,8 +53,7 @@
                 return MALI_CHANNEL_ONE;
 
         default:
-                assert(0);
-                return 0;
+                unreachable("INvalid swizzle");
         }
 }
 
@@ -100,9 +99,7 @@
                 case 32:
                         return MALI_CHANNEL_32;
                 default:
-                        fprintf(stderr, "Unknown width %d\n", size);
-                        assert(0);
-                        return 0;
+                        unreachable("Invalid width");
         }
 }
 
@@ -128,8 +125,7 @@
                         }
 
                 default:
-                        assert(0);
-                        return 0;
+                        unreachable("Invalid type");
         }
 }
 
@@ -232,9 +228,7 @@
                         break;
 
                 default:
-                        fprintf(stderr, "Unknown format type in %s\n", desc->name);
-                        assert(0);
-                        break;
+                        unreachable("Invalid format type");
         }
 
         return (enum mali_format) format;