[Intel-gfx] [PATCH xf86-video-intel 07/21] sna/fb: Eliminate implicit fallthrough

Ville Syrjala ville.syrjala at linux.intel.com
Thu Sep 19 16:30:59 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Duplicate a bit of code in FbDoLeftMaskByteRRop() switch statement
to avoid the fall through.

And while at it sort the cases based on the left byte and length.
Makes the pattern matcher in my brain much happier.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 src/sna/fb/fb.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/sna/fb/fb.h b/src/sna/fb/fb.h
index 904317478e8a..ee5da97b458c 100644
--- a/src/sna/fb/fb.h
+++ b/src/sna/fb/fb.h
@@ -185,11 +185,13 @@ typedef int FbStride;
 	FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
 	FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
 	break; \
+    case sizeof (FbBits) - 3: \
+	FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
+	FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
+	break; \
     case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
 	FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
 	break; \
-    case sizeof (FbBits) - 3: \
-	FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
     case sizeof (FbBits) - 2: \
 	FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
 	break; \
-- 
2.21.0



More information about the Intel-gfx mailing list