Skip to contentSkip to conversation

drm: msm: a5xx: Mark expected switch fall-through

PATCH In review Anders Roxell 1 participant 1 message Jul 26, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/3 drm: msm: a5xx: Mark expected switch fall-through

When fall-through warnings was enabled by default the following warning was starting to show up:

../drivers/gpu/drm/msm/adreno/a5xx_gpu.c: In function ‘a5xx_submit’:
../drivers/gpu/drm/msm/adreno/a5xx_gpu.c:150:7: warning: this statement may fall
through [-Wimplicit-fallthrough=]

    if (priv->lastctx == ctx)
       ^

../drivers/gpu/drm/msm/adreno/a5xx_gpu.c:152:3: note: here
case MSM_SUBMIT_CMD_BUF:
^~~~

Rework so that the compiler doesn't warn about fall-through.

Fixes d93512ef0f0e ("Makefile: Globally enable fall-through warning")
---
 drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +2 -0
index 1671db47aa57..71397ed3c99f 100644
@@ -59,6 +59,7 @@ static void a5xx_submit_in_rb(struct msm_gpu *gpu, struct msm_gem_submit *submit
 		case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
 			if (priv->lastctx == ctx)
 				break;
+			/* Fall through */
 		case MSM_SUBMIT_CMD_BUF:
 			/* copy commands into RB: */
 			obj = submit->bos[submit->cmd[i].idx].obj;
@@ -149,6 +150,7 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
 		case MSM_SUBMIT_CMD_CTX_RESTORE_BUF:
 			if (priv->lastctx == ctx)
 				break;
+			/* Fall through */
 		case MSM_SUBMIT_CMD_BUF:
 			OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
 			OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));
Signature · 1 line
2.20.1