Skip to contentSkip to conversation

staging: rtl8723bs: remove multiple blank lines

PATCH Superseded Serhat Kumral 2 participants 4 messages Jun 21 – Jun 22 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 staging: rtl8723bs: remove multiple blank lines

Remove multiple blank lines in os_intfs.c to conform to the Linux kernel coding style guidelines.
This fixes the checkpatch.pl warnings:
CHECK: Please don't use multiple blank lines

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -6
index f31196f54..a545c3338 100644
@@ -18,7 +18,6 @@ static int rtw_chip_version;
 static int rtw_rfintfs = HWPI;
 static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
 
-
 static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
 /* struct ndis_802_11_ssid	ssid; */
 static int rtw_channel = 1;/* ad-hoc support requirement */
@@ -143,7 +142,6 @@ module_param(rtw_wifi_spec, int, 0644);
 module_param(rtw_antdiv_cfg, int, 0644);
 module_param(rtw_antdiv_type, int, 0644);
 
-
 module_param(rtw_hw_wps_pbc, int, 0644);
 
 static uint rtw_max_roaming_times = 2;
@@ -238,7 +236,6 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
 	registry_par->lowrate_two_xmit = (u8)rtw_lowrate_two_xmit;
 	registry_par->low_power = (u8)rtw_low_power;
 
-
 	registry_par->wifi_spec = (u8)rtw_wifi_spec;
 
 	registry_par->channel_plan = (u8)rtw_channel_plan;
@@ -335,7 +332,6 @@ static unsigned int rtw_classify8021d(struct sk_buff *skb)
 	return dscp >> 5;
 }
 
-
 static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb,
 			    struct net_device *sb_dev)
 {
@@ -633,7 +629,6 @@ void rtw_reset_drv_sw(struct adapter *padapter)
 	rtw_set_signal_stat_timer(&padapter->recvpriv);
 }
 
-
 u8 rtw_init_drv_sw(struct adapter *padapter)
 {
 	int res;
@@ -891,7 +886,6 @@ static int  ips_netdrv_open(struct adapter *padapter)
 	return _FAIL;
 }
 
-
 int rtw_ips_pwr_up(struct adapter *padapter)
 {
 	return ips_netdrv_open(padapter);
Signature · 1 line
2.54.0
#1 lore raw

PATCH 2/3 staging: rtl8723bs: put logical continuation on previous line

Move the logical operator '&&' to the previous line in os_intfs.c to conform to the Linux kernel coding style guidelines. This fixes the checkpatch.pl warning:
CHECK: Logical continuations should be on the previous line

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -2
index a545c3338..89e41c26e 100644
@@ -1018,8 +1018,8 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
 	struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
 
 	if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) {
-		if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
-			&& check_fwstate(pmlmepriv, _FW_LINKED)) {
+		if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
+		    check_fwstate(pmlmepriv, _FW_LINKED)) {
 			rtw_set_to_roam(padapter, 1);
 		}
 	}
Signature · 1 line
2.54.0
#2 lore raw

PATCH 3/3 staging: rtl8723bs: use usleep_range instead of msleep for short delays

In reply to Serhat Kumral

Replace msleep(10) and msleep(1) with usleep_range(10000, 20000) and usleep_range(1000, 2000) respectively in os_intfs.c, because msleep is imprecise and discouraged for short delays under 20ms.
This fixes the checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see function description of msleep().

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +2 -2
index 89e41c26e..5e41f518a 100644
@@ -986,7 +986,7 @@ void rtw_dev_unload(struct adapter *padapter)
 			if (cnt > 5)
 				break;
 			cnt++;
-			msleep(10);
+			usleep_range(10000, 20000);
 		}
 
 		/* check the status of IPS */
@@ -1086,7 +1086,7 @@ void rtw_suspend_common(struct adapter *padapter)
 	pwrpriv->bInSuspend = true;
 
 	while (pwrpriv->bips_processing)
-		msleep(1);
+		usleep_range(1000, 2000);
 
 	if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))
 		return;
Signature · 1 line
2.54.0
#3 lore raw

Re: [PATCH 3/3] staging: rtl8723bs: use usleep_range instead of msleep for short delays

Quoted 16 lines · Serhat Kumral

Replace msleep(10) and msleep(1) with usleep_range(10000, 20000) and usleep_range(1000, 2000) respectively in os_intfs.c, because msleep is imprecise and discouraged for short delays under 20ms.
This fixes the checkpatch.pl warnings:
WARNING: msleep < 20ms can sleep for up to 20ms; see function description of msleep().

---
 drivers/staging/rtl8723bs/os_dep/os_intfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 -0
index 89e41c26e..5e41f518a 100644

drivers/staging/rtl8723bs/os_dep/os_intfs.c void rtw_dev_unload(struct adapter *padapter) · line 989

Quoted 5 lines
drivers/staging/rtl8723bs/os_dep/os_intfs.c +1 -1
@@ -986,7 +986,7 @@ void rtw_dev_unload(struct adapter *padapter)
 			if (cnt > 5)
 				break;
 			cnt++;
-			msleep(10);
+			usleep_range(10000, 20000);

The first two are fine but this isn't. Do a search on lore for the reasons.

regards,
dan carpenter