Skip to contentSkip to conversation

PM / hibernate: Mark expected switch fall-through

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages Aug 5, 2018 – Aug 12, 2018

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

PATCH 1/1 PM / hibernate: Mark expected switch fall-through

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 114713 ("Missing break in switch")

---
 kernel/power/hibernate.c | 1 +
 1 file changed, 1 insertion(+)
kernel/power/hibernate.c +1 -0
index 9c85c78..38f3f96 100644
@@ -638,6 +638,7 @@ static void power_down(void)
 		break;
 	case HIBERNATION_PLATFORM:
 		hibernation_platform_enter();
+		/* Fall through */
 	case HIBERNATION_SHUTDOWN:
 		if (pm_power_off)
 			kernel_power_off();
Signature · 1 line
2.7.4
Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 114713 ("Missing break in switch")

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
In reply to Gustavo A. R. Silva
Quoted 15 lines · CEST Gustavo A. R. Silva

In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through.

Addresses-Coverity-ID: 114713 ("Missing break in switch")

---
 kernel/power/hibernate.c | 1 +
 1 file changed, 1 insertion(+)
kernel/power/hibernate.c +0 -0
index 9c85c78..38f3f96 100644

kernel/power/hibernate.c static void power_down(void) · line 644

Quoted 7 lines
kernel/power/hibernate.c +1 -0
@@ -638,6 +638,7 @@ static void power_down(void)
 		break;
 	case HIBERNATION_PLATFORM:
 		hibernation_platform_enter();
+		/* Fall through */
 	case HIBERNATION_SHUTDOWN:
 		if (pm_power_off)
 			kernel_power_off();

Applied, thanks!