Module: Mesa
Branch: main
Commit: 3b6ceea3e69b6fd55c9bb104dbacffdcf74cb86a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3b6ceea3e69b6fd55c9bb104dbacffdcf74cb86a

Author: Erik Faye-Lund <[email protected]>
Date:   Wed Mar 23 18:34:26 2022 +0100

pvr: do not use fallthrough for unreachable code

unreachable() doesn't lead to executing the code that follows it,
neither in debug nor release builds. So falling through doesn't make any
sense.

This fixes a compile-error on clang.

Let's move the default-block to the end to make it clearer that there's
no intended fallthrough.

Reviewed-by: Frank Binns <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15531>

---

 src/imagination/include/hwdef/rogue_hw_utils.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/imagination/include/hwdef/rogue_hw_utils.h 
b/src/imagination/include/hwdef/rogue_hw_utils.h
index fc1e4e6fd59..39e3bea0b13 100644
--- a/src/imagination/include/hwdef/rogue_hw_utils.h
+++ b/src/imagination/include/hwdef/rogue_hw_utils.h
@@ -75,9 +75,6 @@ rogue_get_isp_samples_per_tile_xy(const struct 
pvr_device_info *dev_info,
    *y_out = tile_size_y;
 
    switch (samples) {
-   default:
-      assert(!"Unsupported number of samples");
-      FALLTHROUGH;
    case 1:
       break;
    case 2:
@@ -96,6 +93,8 @@ rogue_get_isp_samples_per_tile_xy(const struct 
pvr_device_info *dev_info,
    case 8:
       *y_out *= 2;
       break;
+   default:
+      assert(!"Unsupported number of samples");
    }
 }
 

Reply via email to