Skip to contentSkip to conversation

rtw89: ser: add a break statement

PATCH In review Tom Rix 3 participants 3 messages Apr 7, 2022 – Apr 12, 2022

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 rtw89: ser: add a break statement

The clang build fails with
ser.c:397:2: error: unannotated fall-through
between switch labels [-Werror,-Wimplicit-fallthrough]

        default:
        ^

The case above the default does not have a break.
So add one.

---
 drivers/net/wireless/realtek/rtw89/ser.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtw89/ser.c +1 -0
index 25d1df10f226..5aebd6839d29 100644
@@ -394,6 +394,7 @@ static void ser_idle_st_hdl(struct rtw89_ser *ser, u8 evt)
 		break;
 	case SER_EV_STATE_OUT:
 		rtw89_hci_recovery_start(rtwdev);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Tom Rix

The clang build fails with
ser.c:397:2: error: unannotated fall-through
between switch labels [-Werror,-Wimplicit-fallthrough]

        default:
        ^

The case above the default does not have a break.
So add one.

There is also https://lore.kernel.org/r/[email protected]/.

I have been using Documentation/process/deprecated.rst as justification for the extra break, warning aside, as all case statements must end in one of the following:

break
fallthrough
continue
goto
return

Quoted 19 lines
---
 drivers/net/wireless/realtek/rtw89/ser.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/realtek/rtw89/ser.c +1 -0
index 25d1df10f226..5aebd6839d29 100644
@@ -394,6 +394,7 @@ static void ser_idle_st_hdl(struct rtw89_ser *ser, u8 evt)
 		break;
 	case SER_EV_STATE_OUT:
 		rtw89_hci_recovery_start(rtwdev);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.27.0
#2 lore raw
In reply to Tom Rix
Quoted 10 lines · Tom Rix

The clang build fails with
ser.c:397:2: error: unannotated fall-through
between switch labels [-Werror,-Wimplicit-fallthrough]

        default:
        ^

The case above the default does not have a break.
So add one.

I took Zong's version:

https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

Patch set to Superseded.

Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches