Skip to contentSkip to conversation

ARM: OMAP: dma: Mark expected switch fall-throughs

PATCH In review Gustavo A. R. Silva 3 participants 3 messages Jul 28, 2019 – Aug 13, 2019

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

PATCH 1/1 ARM: OMAP: dma: Mark expected switch fall-throughs

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings:

arch/arm/plat-omap/dma.c: In function 'omap_set_dma_src_burst_mode':
arch/arm/plat-omap/dma.c:384:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:393:2: note: here
case OMAP_DMA_DATA_BURST_16:
^~~~
arch/arm/plat-omap/dma.c:394:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:402:2: note: here
default:
^~~~~~~
arch/arm/plat-omap/dma.c: In function 'omap_set_dma_dest_burst_mode':
arch/arm/plat-omap/dma.c:473:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:481:2: note: here
default:
^~~~~~~

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

---
 arch/arm/plat-omap/dma.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
arch/arm/plat-omap/dma.c +5 -9
index 79f43acf9acb..08c99413d02c 100644
@@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 		/*
 		 * not supported by current hardware on OMAP1
 		 * w |= (0x03 << 7);
-		 * fall through
 		 */
+		/* fall through */
 	case OMAP_DMA_DATA_BURST_16:
 		if (dma_omap2plus()) {
 			burst = 0x3;
 			break;
 		}
-		/*
-		 * OMAP1 don't support burst 16
-		 * fall through
-		 */
+		/* OMAP1 don't support burst 16 */
+		/* fall through */
 	default:
 		BUG();
 	}
@@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 			burst = 0x3;
 			break;
 		}
-		/*
-		 * OMAP1 don't support burst 16
-		 * fall through
-		 */
+		/* OMAP1 don't support burst 16 */
+		/* fall through */
 	default:
 		printk(KERN_ERR "Invalid DMA burst mode\n");
 		BUG();
Signature · 1 line
2.22.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings:

arch/arm/plat-omap/dma.c: In function 'omap_set_dma_src_burst_mode':
arch/arm/plat-omap/dma.c:384:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:393:2: note: here
case OMAP_DMA_DATA_BURST_16:
^~~~
arch/arm/plat-omap/dma.c:394:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:402:2: note: here
default:
^~~~~~~
arch/arm/plat-omap/dma.c: In function 'omap_set_dma_dest_burst_mode':
arch/arm/plat-omap/dma.c:473:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:481:2: note: here
default:
^~~~~~~

Quoted 5 lines

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

-Kees

Quoted 45 lines
---
 arch/arm/plat-omap/dma.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
arch/arm/plat-omap/dma.c +5 -9
index 79f43acf9acb..08c99413d02c 100644
@@ -388,17 +388,15 @@ void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 		/*
 		 * not supported by current hardware on OMAP1
 		 * w |= (0x03 << 7);
-		 * fall through
 		 */
+		/* fall through */
 	case OMAP_DMA_DATA_BURST_16:
 		if (dma_omap2plus()) {
 			burst = 0x3;
 			break;
 		}
-		/*
-		 * OMAP1 don't support burst 16
-		 * fall through
-		 */
+		/* OMAP1 don't support burst 16 */
+		/* fall through */
 	default:
 		BUG();
 	}
@@ -474,10 +472,8 @@ void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
 			burst = 0x3;
 			break;
 		}
-		/*
-		 * OMAP1 don't support burst 16
-		 * fall through
-		 */
+		/* OMAP1 don't support burst 16 */
+		/* fall through */
 	default:
 		printk(KERN_ERR "Invalid DMA burst mode\n");
 		BUG();
Signature · 1 line
2.22.0
Signature · 1 line
Kees Cook
#2 lore raw
Quoted 26 lines · Kees Cook
Quoted 25 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

This patch fixes the following warnings:

arch/arm/plat-omap/dma.c: In function 'omap_set_dma_src_burst_mode':
arch/arm/plat-omap/dma.c:384:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:393:2: note: here
case OMAP_DMA_DATA_BURST_16:
^~~~
arch/arm/plat-omap/dma.c:394:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:402:2: note: here
default:
^~~~~~~
arch/arm/plat-omap/dma.c: In function 'omap_set_dma_dest_burst_mode':
arch/arm/plat-omap/dma.c:473:6: warning: this statement may fall through [-Wimplicit-fallthrough=]

   if (dma_omap2plus()) {
      ^

arch/arm/plat-omap/dma.c:481:2: note: here
default:
^~~~~~~

Quoted 7 lines
Quoted 5 lines

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

Applying into fixes thanks.

Tony