Skip to contentSkip to conversation

dmaengine: imx-dma: Mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Jul 29, 2019 – Jul 31, 2019

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

PATCH 1/1 dmaengine: imx-dma: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: arm):

drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (slot == IMX_DMA_2D_SLOT_A) {
      ^

drivers/dma/imx-dma.c:559:2: note: here
case IMXDMA_DESC_MEMCPY:
^~~~

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

---
 drivers/dma/imx-dma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/imx-dma.c +1 -0
index 00a089e24150..5c0fb3134825 100644
@@ -556,6 +556,7 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 		 * We fall-through here intentionally, since a 2D transfer is
 		 * similar to MEMCPY just adding the 2D slot configuration.
 		 */
+		/* Fall through */
 	case IMXDMA_DESC_MEMCPY:
 		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
 		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: arm):

drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (slot == IMX_DMA_2D_SLOT_A) {
      ^
Quoted 8 lines

drivers/dma/imx-dma.c:559:2: note: here
case IMXDMA_DESC_MEMCPY:
^~~~

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

-Kees

Quoted 19 lines
---
 drivers/dma/imx-dma.c | 1 +
 1 file changed, 1 insertion(+)
drivers/dma/imx-dma.c +1 -0
index 00a089e24150..5c0fb3134825 100644
@@ -556,6 +556,7 @@ static int imxdma_xfer_desc(struct imxdma_desc *d)
 		 * We fall-through here intentionally, since a 2D transfer is
 		 * similar to MEMCPY just adding the 2D slot configuration.
 		 */
+		/* Fall through */
 	case IMXDMA_DESC_MEMCPY:
 		imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel));
 		imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel));
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
maintainer Applied
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 6 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warning (Building: arm):

drivers/dma/imx-dma.c: In function ‘imxdma_xfer_desc’:
drivers/dma/imx-dma.c:542:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

Quoted 8 lines
   if (slot == IMX_DMA_2D_SLOT_A) {
      ^

drivers/dma/imx-dma.c:559:2: note: here
case IMXDMA_DESC_MEMCPY:
^~~~

Notice that, in this particular case, the code comment is modified in accordance with what GCC is expecting to find.

Applied, thanks

Signature · 6 lines
~Vinod

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel