Re: [PATCH v2 4/4] Staging: rtl8723bs: fix else after break warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 01, 2024 at 04:04:59PM +0200, Meir Elisha wrote:
> Fix checkpatch warning:
> else is not generally useful after a break or return
> 

This commit message doesn't work.  It needs to explain why you didn't
just delete the else statement and pull the code in tab.  And, honestly,
that's what you should have done...

regards,
dan carpenter

diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index b221913733fb..c99fa5f1716a 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -1552,10 +1552,9 @@ void _rtw_join_timeout_handler(struct timer_list *t)
 					continue;
 				}
 				break;
-			} else {
-				rtw_indicate_disconnect(adapter);
-				break;
 			}
+			rtw_indicate_disconnect(adapter);
+			break;
 		}
 
 	} else {
@@ -2103,12 +2102,12 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
 	}
 
 	iEntry = SecIsInPMKIDList(adapter, pmlmepriv->assoc_bssid);
-	if (iEntry < 0) {
+	if (iEntry < 0)
 		return ielength;
-	} else {
-		if (authmode == WLAN_EID_RSN)
-			ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
-	}
+
+	if (authmode == WLAN_EID_RSN)
+		ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
+
 	return ielength;
 }
 




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux