LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH][next] staging: r8188eu: Fix fall-through warnings for Clang
@ 2021-08-18 22:14 Gustavo A. R. Silva
  2021-08-18 23:32 ` Nathan Chancellor
  0 siblings, 1 reply; 2+ messages in thread
From: Gustavo A. R. Silva @ 2021-08-18 22:14 UTC (permalink / raw)
  To: Larry Finger, Phillip Potter, Greg Kroah-Hartman
  Cc: linux-staging, linux-kernel, Gustavo A. R. Silva, linux-hardening

Fix the following fallthrough warnings:

drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

This helps with the ongoing efforts to globally enable
-Wimplicit-fallthrough for Clang.

Link: https://github.com/KSPP/linux/issues/115 
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/staging/r8188eu/core/rtw_mlme_ext.c  | 1 +
 drivers/staging/r8188eu/core/rtw_wlan_util.c | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
index 61b239651e1a..590a4572c23f 100644
--- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
@@ -1495,6 +1495,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
 			break;
 		case _ERPINFO_IE_:
 			ERP_IE_handler(padapter, pIE);
+			break;
 		default:
 			break;
 		}
diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
index cddacf023fa6..e0ce2b796abe 100644
--- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
+++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
@@ -1110,6 +1110,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
 			case _RSN_IE_2_:
 				if (!memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
 					return true;
+				break;
 			default:
 				break;
 			}
@@ -1144,6 +1145,7 @@ unsigned int should_forbid_n_rate(struct adapter *padapter)
 				if  ((!memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4))  ||
 				     (!memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
 					return false;
+				break;
 			default:
 				break;
 			}
@@ -1401,6 +1403,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
 			} else {
 				break;
 			}
+			break;
 
 		default:
 			break;
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH][next] staging: r8188eu: Fix fall-through warnings for Clang
  2021-08-18 22:14 [PATCH][next] staging: r8188eu: Fix fall-through warnings for Clang Gustavo A. R. Silva
@ 2021-08-18 23:32 ` Nathan Chancellor
  0 siblings, 0 replies; 2+ messages in thread
From: Nathan Chancellor @ 2021-08-18 23:32 UTC (permalink / raw)
  To: Gustavo A. R. Silva, Larry Finger, Phillip Potter, Greg Kroah-Hartman
  Cc: linux-staging, linux-kernel, linux-hardening

On 8/18/2021 3:14 PM, Gustavo A. R. Silva wrote:
> Fix the following fallthrough warnings:
> 
> drivers/staging/r8188eu/core/rtw_mlme_ext.c:1498:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
> drivers/staging/r8188eu/core/rtw_wlan_util.c:1113:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
> drivers/staging/r8188eu/core/rtw_wlan_util.c:1147:4: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
> drivers/staging/r8188eu/core/rtw_wlan_util.c:1405:3: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
> 
> This helps with the ongoing efforts to globally enable
> -Wimplicit-fallthrough for Clang.
> 
> Link: https://github.com/KSPP/linux/issues/115
> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>

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

One small comment below.

> ---
>   drivers/staging/r8188eu/core/rtw_mlme_ext.c  | 1 +
>   drivers/staging/r8188eu/core/rtw_wlan_util.c | 3 +++
>   2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> index 61b239651e1a..590a4572c23f 100644
> --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c
> @@ -1495,6 +1495,7 @@ unsigned int OnAssocRsp(struct adapter *padapter, struct recv_frame *precv_frame
>   			break;
>   		case _ERPINFO_IE_:
>   			ERP_IE_handler(padapter, pIE);
> +			break;
>   		default:
>   			break;
>   		}
> diff --git a/drivers/staging/r8188eu/core/rtw_wlan_util.c b/drivers/staging/r8188eu/core/rtw_wlan_util.c
> index cddacf023fa6..e0ce2b796abe 100644
> --- a/drivers/staging/r8188eu/core/rtw_wlan_util.c
> +++ b/drivers/staging/r8188eu/core/rtw_wlan_util.c
> @@ -1110,6 +1110,7 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
>   			case _RSN_IE_2_:
>   				if (!memcmp((pIE->data + 8), RSN_TKIP_CIPHER, 4))
>   					return true;
> +				break;
>   			default:
>   				break;
>   			}
> @@ -1144,6 +1145,7 @@ unsigned int should_forbid_n_rate(struct adapter *padapter)
>   				if  ((!memcmp((pIE->data + 8), RSN_CIPHER_SUITE_CCMP, 4))  ||
>   				     (!memcmp((pIE->data + 12), RSN_CIPHER_SUITE_CCMP, 4)))
>   					return false;
> +				break;
>   			default:
>   				break;
>   			}
> @@ -1401,6 +1403,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
>   			} else {
>   				break;
>   			}
> +			break;

Would it be better to just remove the else branch at the same time? As 
far as I can tell, there is no reason to have it.

>   
>   		default:
>   			break;
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-18 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-18 22:14 [PATCH][next] staging: r8188eu: Fix fall-through warnings for Clang Gustavo A. R. Silva
2021-08-18 23:32 ` Nathan Chancellor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).