Skip to contentSkip to conversation

staging: rtl8723bs: improve comment placement and readability

PATCH In review Matthew Marsico 2 participants 2 messages Feb 8 – Feb 9 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: rtl8723bs: improve comment placement and readability

Move trailing comments onto their own line, preceding the referenced code, and rework them to improve readability. No functional change.

---
 drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +6 -2
index 587a87fbffeb..fa3b4be11ab2 100644
@@ -174,7 +174,9 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
 						set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
 					}
 				} else {
-					goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
+					/* Driver is already in WIFI_ADHOC_MASTER_STATE, */
+					/* do not create BSS again. */
+					goto release_mlme_lock;
 				}
 			} else {
 				rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_JOINBSS, 1);
@@ -310,7 +312,9 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
 
 		if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
-				rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
+				/* Will clear Linked_state */
+				/* Disassociation has already been handled above */
+				rtw_indicate_disconnect(padapter);
 		}
 
 		*pold_state = networktype;
Signature · 1 line
2.52.0
#1 lore raw
Quoted 14 lines · Matthew Marsico

Move trailing comments onto their own line, preceding the referenced code, and rework them to improve readability. No functional change.

---
 drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +0 -0
index 587a87fbffeb..fa3b4be11ab2 100644

drivers/staging/rtl8723bs/core/rtw_ioctl_set.c u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid) · line 178

Quoted 6 lines
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +2 -1
@@ -174,7 +174,9 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
 						set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
 					}
 				} else {
-					goto release_mlme_lock;/* it means driver is in WIFI_ADHOC_MASTER_STATE, we needn't create bss again. */
+					/* Driver is already in WIFI_ADHOC_MASTER_STATE, */
+					/* do not create BSS again. */

The linux kernel coding style wants multiple line comments to look like this:

/*
* Driver is already in WIFI_ADHOC_MASTER_STATE,
* do not create BSS again.
*/

Please consult Documentation/process/coding-style.rst under Commenting to get more examples.

Quoted 5 lines
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +1 -0
+					goto release_mlme_lock;
 				}
 			} else {
 				rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_JOINBSS, 1);

drivers/staging/rtl8723bs/core/rtw_ioctl_set.c u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, · line 320

Quoted 10 lines
drivers/staging/rtl8723bs/core/rtw_ioctl_set.c +3 -1
@@ -310,7 +312,9 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
 
 		if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
 			if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
-				rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
+				/* Will clear Linked_state */
+				/* Disassociation has already been handled above */
+				rtw_indicate_disconnect(padapter);
 		}
 
 		*pold_state = networktype;

Thanks,

ET