Skip to contentSkip to conversation

floppy: Fix fall-through warning for Clang

PATCH Applied Gustavo A. R. Silva 3 participants 3 messages May 28, 2021 – Jun 4, 2021

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

PATCH v2 1/1 floppy: Fix fall-through warning for Clang

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

---
Changes in v2:
- Add a break statement instead of fallthrough;

 drivers/block/floppy.c | 1 +
 1 file changed, 1 insertion(+)
drivers/block/floppy.c +1 -0
index 8a9d22207c59..803af2a72520 100644
@@ -2123,6 +2123,7 @@ static void format_interrupt(void)
 	switch (interpret_errors()) {
 	case 1:
 		cont->error();
+		break;
 	case 2:
 		break;
 	case 0:
Signature · 1 line
2.27.0
maintainer Applied
#1 lore raw

Hi,

Quoted 8 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Applied, thanks!
https://github.com/evdenis/linux-floppy/commit/6eaddb2a2aa3acd0660537f9f6a12785be0ae830

I will send it to Jens with other floppy patches.
It will be in 5.14

Regards,
Denis

Quoted 20 lines

---
Changes in v2:
- Add a break statement instead of fallthrough;

  drivers/block/floppy.c | 1 +
  1 file changed, 1 insertion(+)
drivers/block/floppy.c +1 -0
index 8a9d22207c59..803af2a72520 100644
@@ -2123,6 +2123,7 @@ static void format_interrupt(void)
  	switch (interpret_errors()) {
  	case 1:
  		cont->error();
+		break;
  	case 2:
  		break;
  	case 0:
#2 lore raw
Quoted 12 lines · Denis Efremov

Hi,

Quoted 8 lines · Gustavo A. R. Silva

In preparation to enable -Wimplicit-fallthrough for Clang, fix a warning by explicitly adding a break statement instead of letting the code fall through to the next case.

Quoted 5 lines

Applied, thanks!
https://github.com/evdenis/linux-floppy/commit/6eaddb2a2aa3acd0660537f9f6a12785be0ae830

I will send it to Jens with other floppy patches.
It will be in 5.14

Awesome. :)

Thanks, Denis.
--
Gustavo