diff mbox series

rtw89: ser: add a break statement

Message ID 20220407175349.3053362-1-trix@redhat.com (mailing list archive)
State Superseded
Delegated to: Kalle Valo
Headers show
Series rtw89: ser: add a break statement | expand

Commit Message

Tom Rix April 7, 2022, 5:53 p.m. UTC
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.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/net/wireless/realtek/rtw89/ser.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Nathan Chancellor April 7, 2022, 6:01 p.m. UTC | #1
On Thu, Apr 07, 2022 at 01:53:49PM -0400, Tom Rix wrote:
> 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.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

There is also https://lore.kernel.org/r/20220407132316.61132-2-pkshih@realtek.com/.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

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

> ---
>  drivers/net/wireless/realtek/rtw89/ser.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c
> index 25d1df10f226..5aebd6839d29 100644
> --- a/drivers/net/wireless/realtek/rtw89/ser.c
> +++ b/drivers/net/wireless/realtek/rtw89/ser.c
> @@ -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;
>  	}
> -- 
> 2.27.0
>
Kalle Valo April 12, 2022, 1:37 p.m. UTC | #2
Tom Rix <trix@redhat.com> wrote:

> 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.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>

I took Zong's version:

https://patchwork.kernel.org/project/linux-wireless/patch/20220408001353.17188-2-pkshih@realtek.com/

Patch set to Superseded.
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtw89/ser.c b/drivers/net/wireless/realtek/rtw89/ser.c
index 25d1df10f226..5aebd6839d29 100644
--- a/drivers/net/wireless/realtek/rtw89/ser.c
+++ b/drivers/net/wireless/realtek/rtw89/ser.c
@@ -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;
 	}