diff mbox series

[xf86-video-intel,07/21] sna/fb: Eliminate implicit fallthrough

Message ID 20190919163113.17402-8-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series Compiler warn elimination | expand

Commit Message

Ville Syrjälä Sept. 19, 2019, 4:30 p.m. UTC
From: Ville Syrjälä <ville.syrjala@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@linux.intel.com>
---
 src/sna/fb/fb.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

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; \