Skip to contentSkip to conversation

ARM: ep93xx: Mark expected switch fall-through

PATCH In review Gustavo A. R. Silva 2 participants 2 messages Aug 8, 2019 – Aug 12, 2019

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

PATCH 1/1 ARM: ep93xx: Mark expected switch fall-through

Mark switch cases where we are expecting to fall through.

Fix the following warnings (Building: arm-ep93xx_defconfig arm):

arch/arm/mach-ep93xx/crunch.c: In function 'crunch_do':
arch/arm/mach-ep93xx/crunch.c:46:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

      memset(crunch_state, 0, sizeof(*crunch_state));
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/arm/mach-ep93xx/crunch.c:53:2: note: here
     case THREAD_NOTIFY_EXIT:
     ^~~~

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

---
 arch/arm/mach-ep93xx/crunch.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-ep93xx/crunch.c +1 -0
index 1c9a4be8b503..1c05c5bf7e5c 100644
@@ -49,6 +49,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
 		 * FALLTHROUGH: Ensure we don't try to overwrite our newly
 		 * initialised state information on the first fault.
 		 */
+		/* Fall through */
 
 	case THREAD_NOTIFY_EXIT:
 		crunch_task_release(thread);
Signature · 7 lines
2.22.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Acked-by on v1 1/1
#1 lore raw

Hi!

Quoted 13 lines · Gustavo A. R. Silva

Mark switch cases where we are expecting to fall through.

Fix the following warnings (Building: arm-ep93xx_defconfig arm):

arch/arm/mach-ep93xx/crunch.c: In function 'crunch_do':
arch/arm/mach-ep93xx/crunch.c:46:3: warning: this statement may fall through [-Wimplicit-fallthrough=]

       memset(crunch_state, 0, sizeof(*crunch_state));
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    arch/arm/mach-ep93xx/crunch.c:53:2: note: here
      case THREAD_NOTIFY_EXIT:
      ^~~~
Quoted 4 lines

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

Quoted 18 lines
---
  arch/arm/mach-ep93xx/crunch.c | 1 +
  1 file changed, 1 insertion(+)
arch/arm/mach-ep93xx/crunch.c +1 -0
index 1c9a4be8b503..1c05c5bf7e5c 100644
@@ -49,6 +49,7 @@ static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t)
  		 * FALLTHROUGH: Ensure we don't try to overwrite our newly
  		 * initialised state information on the first fault.
  		 */
+		/* Fall through */
 
  	case THREAD_NOTIFY_EXIT:
  		crunch_task_release(thread);