Skip to contentSkip to conversation

staging: rtl8188eu: use compound assignment operators

PATCH New Michael Straube 1 participant 2 messages Jun 29, 2020 Staging

lore
Share & tools
lore
#1 lore raw

PATCH 2/2 staging: rtl8188eu: add spaces around operators

In reply to Michael Straube

Add spaces around operators to improve readability and clear checkpatch issues.

---
 drivers/staging/rtl8188eu/core/rtw_pwrctrl.c  |   8 +-
 drivers/staging/rtl8188eu/core/rtw_recv.c     |  70 ++++++------
 drivers/staging/rtl8188eu/core/rtw_security.c | 102 +++++++++---------
 drivers/staging/rtl8188eu/core/rtw_sta_mgt.c  |   2 +-
 .../staging/rtl8188eu/os_dep/ioctl_linux.c    |  50 ++++-----
 5 files changed, 116 insertions(+), 116 deletions(-)
drivers/staging/rtl8188eu/core/rtw_pwrctrl.c +4 -4
index e7777bf3bafb..39ca97411fd5 100644
@@ -205,10 +205,10 @@ static bool rtw_pwr_unassociated_idle(struct adapter *adapter)
 	if (time_after_eq(adapter->pwrctrlpriv.ips_deny_time, jiffies))
 		return false;
 
-	if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE|WIFI_SITE_MONITOR) ||
-	    check_fwstate(pmlmepriv, WIFI_UNDER_LINKING|WIFI_UNDER_WPS) ||
+	if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE | WIFI_SITE_MONITOR) ||
+	    check_fwstate(pmlmepriv, WIFI_UNDER_LINKING | WIFI_UNDER_WPS) ||
 	    check_fwstate(pmlmepriv, WIFI_AP_STATE) ||
-	    check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE|WIFI_ADHOC_STATE))
+	    check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE | WIFI_ADHOC_STATE))
 		return false;
 
 	return true;
@@ -249,7 +249,7 @@ void rtw_ps_processor(struct adapter *padapter)
 	if (!rtw_pwr_unassociated_idle(padapter))
 		goto exit;
 
-	if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts%4) == 0)) {
+	if ((pwrpriv->rf_pwrstate == rf_on) && ((pwrpriv->pwr_state_check_cnts % 4) == 0)) {
 		DBG_88E("==>%s .fw_state(%x)\n", __func__, get_fwstate(pmlmepriv));
 		pwrpriv->change_rfpwrstate = rf_off;
 
drivers/staging/rtl8188eu/core/rtw_recv.c +35 -35

172 lines not on this page · raw message

drivers/staging/rtl8188eu/core/rtw_security.c +51 -51

256 lines not on this page · raw message

drivers/staging/rtl8188eu/core/rtw_sta_mgt.c +1 -1
index 73f2cb5ebaa6..3c03141e25b1 100644
@@ -112,7 +112,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
 
 inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
 {
-	int offset = (((u8 *)sta) - stapriv->pstainfo_buf)/sizeof(struct sta_info);
+	int offset = (((u8 *)sta) - stapriv->pstainfo_buf) / sizeof(struct sta_info);
 
 	if (!stainfo_offset_valid(offset))
 		DBG_88E("%s invalid offset(%d), out of range!!!", __func__, offset);
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +25 -25

191 lines not on this page · raw message

Signature · 1 line
2.27.0
#0 lore raw

PATCH 1/2 staging: rtl8188eu: use compound assignment operators

Use compound assignment operators to simplify the code and clear missing spaces around operators checkpatch issues.

---
 drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +2 -2
index d5968ef9f43d..68196d8c05eb 100644
@@ -211,7 +211,7 @@ static char *translate_scan(struct adapter *padapter,
 		else/* default MCS7 */
 			max_rate = (bw_40MHz) ? ((short_GI) ? 150 : 135) : ((short_GI) ? 72 : 65);
 
-		max_rate = max_rate*2;/* Mbps/2; */
+		max_rate *= 2; /* Mbps/2; */
 	}
 
 	iwe.cmd = SIOCGIWRATE;
@@ -1395,7 +1395,7 @@ static int rtw_wx_set_rate(struct net_device *dev,
 		ratevalue = 11;
 		goto set_rate;
 	}
-	target_rate = target_rate/100000;
+	target_rate /= 100000;
 
 	switch (target_rate) {
 	case 10:
Signature · 1 line
2.27.0