linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting
@ 2018-09-30 19:52 Michael Straube
  2018-09-30 19:52 ` [PATCH 02/19] staging: rtl8188eu: rename odm_HWConfig Michael Straube
                   ` (18 more replies)
  0 siblings, 19 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Cleanup all inconsistent indenting reported by smatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/core/rtw_efuse.c    |  2 +-
 .../staging/rtl8188eu/core/rtw_ieee80211.c    |  2 +-
 drivers/staging/rtl8188eu/core/rtw_led.c      |  4 ++--
 drivers/staging/rtl8188eu/core/rtw_mlme.c     | 16 +++++++--------
 drivers/staging/rtl8188eu/core/rtw_recv.c     |  2 +-
 drivers/staging/rtl8188eu/core/rtw_security.c |  5 ++---
 .../rtl8188eu/hal/hal8188e_rate_adaptive.c    | 18 +++++++++--------
 drivers/staging/rtl8188eu/hal/odm_HWConfig.c  |  2 +-
 drivers/staging/rtl8188eu/hal/usb_halinit.c   | 20 +++++++++----------
 .../staging/rtl8188eu/os_dep/ioctl_linux.c    | 10 +++++-----
 drivers/staging/rtl8188eu/os_dep/mlme_linux.c |  2 +-
 drivers/staging/rtl8188eu/os_dep/os_intfs.c   |  2 +-
 12 files changed, 43 insertions(+), 42 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c
index 4988d97ca0d1..cb6d1fb776da 100644
--- a/drivers/staging/rtl8188eu/core/rtw_efuse.c
+++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c
@@ -37,7 +37,7 @@ void efuse_power_switch(struct adapter *pAdapter, u8 write, u8 pwrstate)
 		tmpv16 = usb_read16(pAdapter, REG_SYS_ISO_CTRL);
 		if (!(tmpv16 & PWC_EV12V)) {
 			tmpv16 |= PWC_EV12V;
-			 usb_write16(pAdapter, REG_SYS_ISO_CTRL, tmpv16);
+			usb_write16(pAdapter, REG_SYS_ISO_CTRL, tmpv16);
 		}
 		/*  Reset: 0x0000h[28], default valid */
 		tmpv16 =  usb_read16(pAdapter, REG_SYS_FUNC_EN);
diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 20f34d25c369..5c4ff81987bd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -246,7 +246,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
 		wireless_mode = pregistrypriv->wireless_mode;
 	}
 
-		rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);
+	rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);
 
 	rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);
 
diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c
index 98106e77a9f6..a2e7789aecbd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_led.c
+++ b/drivers/staging/rtl8188eu/core/rtw_led.c
@@ -357,7 +357,7 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
 		}
 		if (pLed->bLedLinkBlinkInProgress) {
 			del_timer_sync(&pLed->BlinkTimer);
-			 pLed->bLedLinkBlinkInProgress = false;
+			pLed->bLedLinkBlinkInProgress = false;
 		}
 		if (pLed->bLedBlinkInProgress) {
 			del_timer_sync(&pLed->BlinkTimer);
@@ -383,7 +383,7 @@ static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAct
 		}
 		if (pLed->bLedLinkBlinkInProgress) {
 			del_timer_sync(&pLed->BlinkTimer);
-			 pLed->bLedLinkBlinkInProgress = false;
+			pLed->bLedLinkBlinkInProgress = false;
 		}
 		if (pLed->bLedBlinkInProgress) {
 			del_timer_sync(&pLed->BlinkTimer);
diff --git a/drivers/staging/rtl8188eu/core/rtw_mlme.c b/drivers/staging/rtl8188eu/core/rtw_mlme.c
index d18d34313a9e..858b597cb506 100644
--- a/drivers/staging/rtl8188eu/core/rtw_mlme.c
+++ b/drivers/staging/rtl8188eu/core/rtw_mlme.c
@@ -305,7 +305,7 @@ static int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
 
 int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst)
 {
-	 u16 s_cap, d_cap;
+	u16 s_cap, d_cap;
 	__le16 le_scap, le_dcap;
 
 	memcpy((u8 *)&le_scap, rtw_get_capability_from_ie(src->ies), 2);
@@ -842,7 +842,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
 	if (psta) { /* update ptarget_sta */
 		DBG_88E("%s\n", __func__);
 		psta->aid  = pnetwork->join_res;
-			psta->mac_id = 0;
+		psta->mac_id = 0;
 		/* sta mode */
 		rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true);
 		/* security related */
@@ -1038,12 +1038,12 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
 			}
 
 			/* s4. indicate connect */
-				if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
-					rtw_indicate_connect(adapter);
-				} else {
-					/* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */
-					RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv)));
-				}
+			if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) == true) {
+				rtw_indicate_connect(adapter);
+			} else {
+				/* adhoc mode will rtw_indicate_connect when rtw_stassoc_event_callback */
+				RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("adhoc mode, fw_state:%x", get_fwstate(pmlmepriv)));
+			}
 
 			/* s5. Cancel assoc_timer */
 			del_timer_sync(&pmlmepriv->assoc_timer);
diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c
index f3eb63f8cf0b..380d544c8ca7 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -488,7 +488,7 @@ static struct recv_frame *portctrl(struct adapter *adapter,
 		prtnframe = precv_frame;
 	}
 
-		return prtnframe;
+	return prtnframe;
 }
 
 static int recv_decache(struct recv_frame *precv_frame, u8 bretry,
diff --git a/drivers/staging/rtl8188eu/core/rtw_security.c b/drivers/staging/rtl8188eu/core/rtw_security.c
index a2ec0e403718..f7407632e80b 100644
--- a/drivers/staging/rtl8188eu/core/rtw_security.c
+++ b/drivers/staging/rtl8188eu/core/rtw_security.c
@@ -353,7 +353,7 @@ void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, u32 data_len, u8 *mic_cod
 
 	/* Michael MIC pseudo header: DA, SA, 3 x 0, Priority */
 	if (header[1]&1) {   /* ToDS == 1 */
-			rtw_secmicappend(&micdata, &header[16], 6);  /* DA */
+		rtw_secmicappend(&micdata, &header[16], 6);  /* DA */
 		if (header[1]&2)  /* From Ds == 1 */
 			rtw_secmicappend(&micdata, &header[24], 6);
 		else
@@ -1273,8 +1273,7 @@ u32	rtw_aes_encrypt(struct adapter *padapter, u8 *pxmitframe)
 		}
 	}
 
-
-		return res;
+	return res;
 }
 
 u32 rtw_aes_decrypt(struct adapter *padapter, u8 *precvframe)
diff --git a/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
index 464c11710398..6dbd7d261f1e 100644
--- a/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
+++ b/drivers/staging/rtl8188eu/hal/hal8188e_rate_adaptive.c
@@ -418,14 +418,16 @@ static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf
 	} else {
 		pRaInfo->LowestRate = 0;
 	}
-		if (pRaInfo->HighestRate > 0x13)
-			pRaInfo->PTModeSS = 3;
-		else if (pRaInfo->HighestRate > 0x0b)
-			pRaInfo->PTModeSS = 2;
-		else if (pRaInfo->HighestRate > 0x0b)
-			pRaInfo->PTModeSS = 1;
-		else
-			pRaInfo->PTModeSS = 0;
+
+	if (pRaInfo->HighestRate > 0x13)
+		pRaInfo->PTModeSS = 3;
+	else if (pRaInfo->HighestRate > 0x0b)
+		pRaInfo->PTModeSS = 2;
+	else if (pRaInfo->HighestRate > 0x0b)
+		pRaInfo->PTModeSS = 1;
+	else
+		pRaInfo->PTModeSS = 0;
+
 	ODM_RT_TRACE(dm_odm, ODM_COMP_RATE_ADAPTIVE, ODM_DBG_LOUD,
 		     ("ODM_ARFBRefresh_8188E(): PTModeSS =%d\n", pRaInfo->PTModeSS));
 
diff --git a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c
index 0464dc41f860..9d63afd4f99f 100644
--- a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_HWConfig.c
@@ -185,7 +185,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 
 		/*  (1)Get RSSI for HT rate */
 
-		 for (i = RF_PATH_A; i < RF_PATH_MAX; i++) {
+		for (i = RF_PATH_A; i < RF_PATH_MAX; i++) {
 			/*  2008/01/30 MH we will judge RF RX path now. */
 			if (dm_odm->RFPathRxEnable & BIT(i))
 				rf_rx_num++;
diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b/drivers/staging/rtl8188eu/hal/usb_halinit.c
index 12864b648fa8..75a28bf095fb 100644
--- a/drivers/staging/rtl8188eu/hal/usb_halinit.c
+++ b/drivers/staging/rtl8188eu/hal/usb_halinit.c
@@ -785,13 +785,13 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
 	haldata->RfRegChnlVal[0] = rtw_hal_read_rfreg(Adapter, (enum rf_radio_path)0, RF_CHNLBW, bRFRegOffsetMask);
 	haldata->RfRegChnlVal[1] = rtw_hal_read_rfreg(Adapter, (enum rf_radio_path)1, RF_CHNLBW, bRFRegOffsetMask);
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK);
+	HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK);
 	_BBTurnOnBlock(Adapter);
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_SECURITY);
+	HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_SECURITY);
 	invalidate_cam_all(Adapter);
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
+	HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
 	/*  2010/12/17 MH We need to set TX power according to EFUSE content at first. */
 	phy_set_tx_power_level(Adapter, haldata->CurrentChannel);
 
@@ -816,7 +816,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
 	/* Nav limit , suggest by scott */
 	usb_write8(Adapter, 0x652, 0x0);
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
+	HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
 	rtl8188e_InitHalDm(Adapter);
 
 	/*  2010/08/11 MH Merge from 8192SE for Minicard init. We need to confirm current radio status */
@@ -840,8 +840,8 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
 	/* enable tx DMA to drop the redundate data of packet */
 	usb_write16(Adapter, REG_TXDMA_OFFSET_CHK, (usb_read16(Adapter, REG_TXDMA_OFFSET_CHK) | DROP_DATA_EN));
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
-		/*  2010/08/26 MH Merge from 8192CE. */
+	HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
+	/*  2010/08/26 MH Merge from 8192CE. */
 	if (pwrctrlpriv->rf_pwrstate == rf_on) {
 		if (haldata->odmpriv.RFCalibrateInfo.bIQKInitialized) {
 			rtl88eu_phy_iq_calibrate(Adapter, true);
@@ -850,12 +850,12 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
 			haldata->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
 		}
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_PW_TRACK);
+		HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_PW_TRACK);
 
 		ODM_TXPowerTrackingCheck(&haldata->odmpriv);
 
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
-			rtl88eu_phy_lc_calibrate(Adapter);
+		HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
+		rtl88eu_phy_lc_calibrate(Adapter);
 	}
 
 /* HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PABIAS); */
@@ -866,7 +866,7 @@ HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
 	usb_write32(Adapter, REG_FWHW_TXQ_CTRL, usb_read32(Adapter, REG_FWHW_TXQ_CTRL) | BIT(12));
 
 exit:
-HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_END);
+	HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_END);
 
 	DBG_88E("%s in %dms\n", __func__,
 		jiffies_to_msecs(jiffies - init_start_time));
diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
index 4801345a2b57..408fabf9f34a 100644
--- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c
@@ -421,7 +421,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
 				ret = -EOPNOTSUPP;
 				goto exit;
 			}
-		      memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
+			memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
 			psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
 			rtw_set_key(padapter, psecuritypriv, wep_key_idx, 0);
 		}
@@ -1317,8 +1317,8 @@ static int rtw_wx_set_essid(struct net_device *dev,
 
 		RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("rtw_wx_set_essid: ssid =[%s]\n", src_ssid));
 		spin_lock_bh(&queue->lock);
-	       phead = get_list_head(queue);
-	      pmlmepriv->pscanned = phead->next;
+		phead = get_list_head(queue);
+		pmlmepriv->pscanned = phead->next;
 
 		while (phead != pmlmepriv->pscanned) {
 			pnetwork = container_of(pmlmepriv->pscanned, struct wlan_network, list);
@@ -1400,7 +1400,7 @@ static int rtw_wx_set_rate(struct net_device *dev,
 	u32	target_rate = wrqu->bitrate.value;
 	u32	fixed = wrqu->bitrate.fixed;
 	u32	ratevalue = 0;
-	 u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
+	u8 mpdatarate[NumRates] = {11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0xff};
 
 	RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, (" rtw_wx_set_rate\n"));
 	RT_TRACE(_module_rtl871x_ioctl_os_c, _drv_info_, ("target_rate = %d, fixed = %d\n", target_rate, fixed));
@@ -2278,7 +2278,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param,
 			/* don't update "psecuritypriv->dot11PrivacyAlgrthm" and */
 			/* psecuritypriv->dot11PrivacyKeyIndex = keyid", but can rtw_set_key to cam */
 
-		      memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
+			memcpy(&(psecuritypriv->dot11DefKey[wep_key_idx].skey[0]), pwep->KeyMaterial, pwep->KeyLength);
 
 			psecuritypriv->dot11DefKeylen[wep_key_idx] = pwep->KeyLength;
 
diff --git a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
index 238c1d9cdc7b..d5ceb3beabbc 100644
--- a/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/mlme_linux.c
@@ -78,7 +78,7 @@ void rtw_os_indicate_disconnect(struct adapter *adapter)
 {
 	netif_carrier_off(adapter->pnetdev); /*  Do it first for tx broadcast pkt after disconnection issue! */
 	rtw_indicate_wx_disassoc_event(adapter);
-	 rtw_reset_securitypriv(adapter);
+	rtw_reset_securitypriv(adapter);
 }
 
 void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
index 0a9877d85c79..dac9f98b4808 100644
--- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c
+++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c
@@ -643,7 +643,7 @@ int  ips_netdrv_open(struct adapter *padapter)
 	mod_timer(&padapter->mlmepriv.dynamic_chk_timer,
 		  jiffies + msecs_to_jiffies(5000));
 
-	 return _SUCCESS;
+	return _SUCCESS;
 
 netdev_open_error:
 	DBG_88E("-ips_netdrv_open - drv_open failure, bup =%d\n", padapter->bup);
-- 
2.19.0


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

* [PATCH 02/19] staging: rtl8188eu: rename odm_HWConfig
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:52 ` [PATCH 03/19] staging: rtl8188eu: remove wrapper odm_SignalScaleMapping() Michael Straube
                   ` (17 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename source and header file to avoid CamelCase.
odm_HWConfig.c -> odm_hwconfig.c
odm_HWConfig.h -> odm_hwconfig.h

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/Makefile                              | 2 +-
 .../staging/rtl8188eu/hal/{odm_HWConfig.c => odm_hwconfig.c}    | 0
 .../rtl8188eu/include/{odm_HWConfig.h => odm_hwconfig.h}        | 0
 drivers/staging/rtl8188eu/include/odm_precomp.h                 | 2 +-
 4 files changed, 2 insertions(+), 2 deletions(-)
 rename drivers/staging/rtl8188eu/hal/{odm_HWConfig.c => odm_hwconfig.c} (100%)
 rename drivers/staging/rtl8188eu/include/{odm_HWConfig.h => odm_hwconfig.h} (100%)

diff --git a/drivers/staging/rtl8188eu/Makefile b/drivers/staging/rtl8188eu/Makefile
index 4e606b03ec03..7da911c2ab89 100644
--- a/drivers/staging/rtl8188eu/Makefile
+++ b/drivers/staging/rtl8188eu/Makefile
@@ -28,7 +28,7 @@ r8188eu-y :=				\
 		hal/hal_intf.o		\
 		hal/hal_com.o		\
 		hal/odm.o		\
-		hal/odm_HWConfig.o	\
+		hal/odm_hwconfig.o	\
 		hal/odm_rtl8188e.o	\
 		hal/rtl8188e_cmd.o	\
 		hal/rtl8188e_dm.o	\
diff --git a/drivers/staging/rtl8188eu/hal/odm_HWConfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
similarity index 100%
rename from drivers/staging/rtl8188eu/hal/odm_HWConfig.c
rename to drivers/staging/rtl8188eu/hal/odm_hwconfig.c
diff --git a/drivers/staging/rtl8188eu/include/odm_HWConfig.h b/drivers/staging/rtl8188eu/include/odm_hwconfig.h
similarity index 100%
rename from drivers/staging/rtl8188eu/include/odm_HWConfig.h
rename to drivers/staging/rtl8188eu/include/odm_hwconfig.h
diff --git a/drivers/staging/rtl8188eu/include/odm_precomp.h b/drivers/staging/rtl8188eu/include/odm_precomp.h
index 0cf7f82b805f..6efddc8f1675 100644
--- a/drivers/staging/rtl8188eu/include/odm_precomp.h
+++ b/drivers/staging/rtl8188eu/include/odm_precomp.h
@@ -22,7 +22,7 @@
 /* 2 OutSrc Header Files */
 
 #include "odm.h"
-#include "odm_HWConfig.h"
+#include "odm_hwconfig.h"
 #include "odm_debug.h"
 #include "../../rtlwifi/phydm/phydm_regdefine11n.h"
 
-- 
2.19.0


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

* [PATCH 03/19] staging: rtl8188eu: remove wrapper odm_SignalScaleMapping()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
  2018-09-30 19:52 ` [PATCH 02/19] staging: rtl8188eu: rename odm_HWConfig Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:52 ` [PATCH 04/19] staging: rtl8188eu: add spaces around '+' in odm_hwconfig.c Michael Straube
                   ` (16 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

The function odm_SignalScaleMapping() is just a wrapper for
odm_SignalScaleMapping_92CSeries().

Rename odm_SignalScaleMapping_92CSeries() to odm_SignalScaleMapping()
and remove the wrapper.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 9d63afd4f99f..6cc1f1f6448d 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -26,7 +26,7 @@ static u8 odm_QueryRxPwrPercentage(s8 AntPower)
 
 /*  2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. */
 /*  IF other SW team do not support the feature, remove this section.?? */
-static s32 odm_SignalScaleMapping_92CSeries(struct odm_dm_struct *dm_odm, s32 CurrSig)
+static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
 {
 	s32 RetSig = 0;
 
@@ -49,11 +49,6 @@ static s32 odm_SignalScaleMapping_92CSeries(struct odm_dm_struct *dm_odm, s32 Cu
 	return RetSig;
 }
 
-static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
-{
-	return odm_SignalScaleMapping_92CSeries(dm_odm, CurrSig);
-}
-
 static u8 odm_EVMdbToPercentage(s8 Value)
 {
 	/*  -33dB~0dB to 0%~99% */
-- 
2.19.0


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

* [PATCH 04/19] staging: rtl8188eu: add spaces around '+' in odm_hwconfig.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
  2018-09-30 19:52 ` [PATCH 02/19] staging: rtl8188eu: rename odm_HWConfig Michael Straube
  2018-09-30 19:52 ` [PATCH 03/19] staging: rtl8188eu: remove wrapper odm_SignalScaleMapping() Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:52 ` [PATCH 05/19] staging: rtl8188eu: add spaces around '*' " Michael Straube
                   ` (15 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Add spaces around '+' in odm_hwconfig.c to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 6cc1f1f6448d..b227752f3f00 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -21,7 +21,7 @@ static u8 odm_QueryRxPwrPercentage(s8 AntPower)
 	else if (AntPower >= 0)
 		return	100;
 	else
-		return 100+AntPower;
+		return 100 + AntPower;
 }
 
 /*  2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. */
@@ -145,7 +145,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 		PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
 		if (!cck_highpwr) {
 			if (PWDB_ALL >= 80)
-				PWDB_ALL = ((PWDB_ALL-80)<<1)+((PWDB_ALL-80)>>1)+80;
+				PWDB_ALL = ((PWDB_ALL-80)<<1) + ((PWDB_ALL-80)>>1) + 80;
 			else if ((PWDB_ALL <= 78) && (PWDB_ALL >= 20))
 				PWDB_ALL += 3;
 			if (PWDB_ALL > 100)
@@ -377,7 +377,7 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm,
 
 		if (pEntry->rssi_stat.ValidBit == 64) {
 			Weighting = min_t(u32, OFDM_pkt << 4, 64);
-			UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM+(64-Weighting)*UndecoratedSmoothedCCK)>>6;
+			UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM + (64-Weighting)*UndecoratedSmoothedCCK)>>6;
 		} else {
 			if (pEntry->rssi_stat.ValidBit != 0)
 				UndecoratedSmoothedPWDB = (OFDM_pkt * UndecoratedSmoothedOFDM +
-- 
2.19.0


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

* [PATCH 05/19] staging: rtl8188eu: add spaces around '*' in odm_hwconfig.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (2 preceding siblings ...)
  2018-09-30 19:52 ` [PATCH 04/19] staging: rtl8188eu: add spaces around '+' in odm_hwconfig.c Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:52 ` [PATCH 06/19] staging: rtl8188eu: replace tabs with spaces " Michael Straube
                   ` (14 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Add spaces around '*' in odm_hwconfig.c to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 28 ++++++++++----------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index b227752f3f00..e9e5d2a6a06c 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -33,7 +33,7 @@ static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
 	if (CurrSig >= 51 && CurrSig <= 100)
 		RetSig = 100;
 	else if (CurrSig >= 41 && CurrSig <= 50)
-		RetSig = 80 + ((CurrSig - 40)*2);
+		RetSig = 80 + ((CurrSig - 40) * 2);
 	else if (CurrSig >= 31 && CurrSig <= 40)
 		RetSig = 66 + (CurrSig - 30);
 	else if (CurrSig >= 21 && CurrSig <= 30)
@@ -110,33 +110,33 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 		switch (LNA_idx) {
 		case 7:
 			if (VGA_idx <= 27)
-				rx_pwr_all = -100 + 2*(27-VGA_idx); /* VGA_idx = 27~2 */
+				rx_pwr_all = -100 + 2 * (27-VGA_idx); /* VGA_idx = 27~2 */
 			else
 				rx_pwr_all = -100;
 			break;
 		case 6:
-			rx_pwr_all = -48 + 2*(2-VGA_idx); /* VGA_idx = 2~0 */
+			rx_pwr_all = -48 + 2 * (2-VGA_idx); /* VGA_idx = 2~0 */
 			break;
 		case 5:
-			rx_pwr_all = -42 + 2*(7-VGA_idx); /* VGA_idx = 7~5 */
+			rx_pwr_all = -42 + 2 * (7-VGA_idx); /* VGA_idx = 7~5 */
 			break;
 		case 4:
-			rx_pwr_all = -36 + 2*(7-VGA_idx); /* VGA_idx = 7~4 */
+			rx_pwr_all = -36 + 2 * (7-VGA_idx); /* VGA_idx = 7~4 */
 			break;
 		case 3:
-			rx_pwr_all = -24 + 2*(7-VGA_idx); /* VGA_idx = 7~0 */
+			rx_pwr_all = -24 + 2 * (7-VGA_idx); /* VGA_idx = 7~0 */
 			break;
 		case 2:
 			if (cck_highpwr)
-				rx_pwr_all = -12 + 2*(5-VGA_idx); /* VGA_idx = 5~0 */
+				rx_pwr_all = -12 + 2 * (5-VGA_idx); /* VGA_idx = 5~0 */
 			else
-				rx_pwr_all = -6 + 2*(5-VGA_idx);
+				rx_pwr_all = -6 + 2 * (5-VGA_idx);
 			break;
 		case 1:
-			rx_pwr_all = 8-2*VGA_idx;
+			rx_pwr_all = 8-2 * VGA_idx;
 			break;
 		case 0:
-			rx_pwr_all = 14-2*VGA_idx;
+			rx_pwr_all = 14-2 * VGA_idx;
 			break;
 		default:
 			break;
@@ -185,7 +185,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 			if (dm_odm->RFPathRxEnable & BIT(i))
 				rf_rx_num++;
 
-			rx_pwr[i] = ((pPhyStaRpt->path_agc[i].gain & 0x3F)*2) - 110;
+			rx_pwr[i] = ((pPhyStaRpt->path_agc[i].gain & 0x3F) * 2) - 110;
 
 			pPhyInfo->RxPwr[i] = rx_pwr[i];
 
@@ -334,12 +334,12 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm,
 			} else {
 				if (pPhyInfo->RxPWDBAll > (u32)UndecoratedSmoothedOFDM) {
 					UndecoratedSmoothedOFDM =
-							(((UndecoratedSmoothedOFDM)*(Rx_Smooth_Factor-1)) +
+							(((UndecoratedSmoothedOFDM) * (Rx_Smooth_Factor-1)) +
 							(RSSI_Ave)) / (Rx_Smooth_Factor);
 					UndecoratedSmoothedOFDM = UndecoratedSmoothedOFDM + 1;
 				} else {
 					UndecoratedSmoothedOFDM =
-							(((UndecoratedSmoothedOFDM)*(Rx_Smooth_Factor-1)) +
+							(((UndecoratedSmoothedOFDM) * (Rx_Smooth_Factor-1)) +
 							(RSSI_Ave)) / (Rx_Smooth_Factor);
 				}
 			}
@@ -377,7 +377,7 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm,
 
 		if (pEntry->rssi_stat.ValidBit == 64) {
 			Weighting = min_t(u32, OFDM_pkt << 4, 64);
-			UndecoratedSmoothedPWDB = (Weighting*UndecoratedSmoothedOFDM + (64-Weighting)*UndecoratedSmoothedCCK)>>6;
+			UndecoratedSmoothedPWDB = (Weighting * UndecoratedSmoothedOFDM + (64-Weighting) * UndecoratedSmoothedCCK)>>6;
 		} else {
 			if (pEntry->rssi_stat.ValidBit != 0)
 				UndecoratedSmoothedPWDB = (OFDM_pkt * UndecoratedSmoothedOFDM +
-- 
2.19.0


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

* [PATCH 06/19] staging: rtl8188eu: replace tabs with spaces in odm_hwconfig.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (3 preceding siblings ...)
  2018-09-30 19:52 ` [PATCH 05/19] staging: rtl8188eu: add spaces around '*' " Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:52 ` [PATCH 07/19] staging: rtl8188eu: rename parameter of odm_QueryRxPwrPercentage() Michael Straube
                   ` (13 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Replace tabs with spaces in odm_hwconfig.c where appropriate.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index e9e5d2a6a06c..ada59a671da4 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -17,9 +17,9 @@
 static u8 odm_QueryRxPwrPercentage(s8 AntPower)
 {
 	if ((AntPower <= -100) || (AntPower >= 20))
-		return	0;
+		return 0;
 	else if (AntPower >= 0)
-		return	100;
+		return 100;
 	else
 		return 100 + AntPower;
 }
-- 
2.19.0


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

* [PATCH 07/19] staging: rtl8188eu: rename parameter of odm_QueryRxPwrPercentage()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (4 preceding siblings ...)
  2018-09-30 19:52 ` [PATCH 06/19] staging: rtl8188eu: replace tabs with spaces " Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:52 ` [PATCH 08/19] staging: rtl8188eu: rename odm_QueryRxPwrPercentage() Michael Straube
                   ` (12 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename parameter of odm_QueryRxPwrPercentage() to avoid CamelCase.
AntPower -> antpower

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index ada59a671da4..dca39df3d8ba 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -14,14 +14,14 @@
 #define READ_AND_CONFIG_MP(ic, txt) (ODM_ReadAndConfig##txt##ic(dm_odm))
 #define READ_AND_CONFIG_TC(ic, txt) (ODM_ReadAndConfig_TC##txt##ic(dm_odm))
 
-static u8 odm_QueryRxPwrPercentage(s8 AntPower)
+static u8 odm_QueryRxPwrPercentage(s8 antpower)
 {
-	if ((AntPower <= -100) || (AntPower >= 20))
+	if ((antpower <= -100) || (antpower >= 20))
 		return 0;
-	else if (AntPower >= 0)
+	else if (antpower >= 0)
 		return 100;
 	else
-		return 100 + AntPower;
+		return 100 + antpower;
 }
 
 /*  2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. */
-- 
2.19.0


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

* [PATCH 08/19] staging: rtl8188eu: rename odm_QueryRxPwrPercentage()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (5 preceding siblings ...)
  2018-09-30 19:52 ` [PATCH 07/19] staging: rtl8188eu: rename parameter of odm_QueryRxPwrPercentage() Michael Straube
@ 2018-09-30 19:52 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 09/19] staging: rtl8188eu: rename parameter of odm_EVMdbToPercentage() Michael Straube
                   ` (11 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:52 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename odm_QueryRxPwrPercentage() to avoid CamelCase.
odm_QueryRxPwrPercentage -> odm_query_rxpwrpercentage

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index dca39df3d8ba..07291ca90681 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -14,7 +14,7 @@
 #define READ_AND_CONFIG_MP(ic, txt) (ODM_ReadAndConfig##txt##ic(dm_odm))
 #define READ_AND_CONFIG_TC(ic, txt) (ODM_ReadAndConfig_TC##txt##ic(dm_odm))
 
-static u8 odm_QueryRxPwrPercentage(s8 antpower)
+static u8 odm_query_rxpwrpercentage(s8 antpower)
 {
 	if ((antpower <= -100) || (antpower >= 20))
 		return 0;
@@ -142,7 +142,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 			break;
 		}
 		rx_pwr_all += 6;
-		PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
+		PWDB_ALL = odm_query_rxpwrpercentage(rx_pwr_all);
 		if (!cck_highpwr) {
 			if (PWDB_ALL >= 80)
 				PWDB_ALL = ((PWDB_ALL-80)<<1) + ((PWDB_ALL-80)>>1) + 80;
@@ -190,7 +190,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 			pPhyInfo->RxPwr[i] = rx_pwr[i];
 
 			/* Translate DBM to percentage. */
-			RSSI = odm_QueryRxPwrPercentage(rx_pwr[i]);
+			RSSI = odm_query_rxpwrpercentage(rx_pwr[i]);
 			total_rssi += RSSI;
 
 			/* Modification for ext-LNA board */
@@ -213,7 +213,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 		/*  (2)PWDB, Average PWDB calculated by hardware (for rate adaptive) */
 		rx_pwr_all = (((pPhyStaRpt->cck_sig_qual_ofdm_pwdb_all) >> 1) & 0x7f) - 110;
 
-		PWDB_ALL = odm_QueryRxPwrPercentage(rx_pwr_all);
+		PWDB_ALL = odm_query_rxpwrpercentage(rx_pwr_all);
 		PWDB_ALL_BT = PWDB_ALL;
 
 		pPhyInfo->RxPWDBAll = PWDB_ALL;
-- 
2.19.0


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

* [PATCH 09/19] staging: rtl8188eu: rename parameter of odm_EVMdbToPercentage()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (6 preceding siblings ...)
  2018-09-30 19:52 ` [PATCH 08/19] staging: rtl8188eu: rename odm_QueryRxPwrPercentage() Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 10/19] staging: rtl8188eu: rename odm_EVMdbToPercentage() Michael Straube
                   ` (10 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename parameter of odm_EVMdbToPercentage() to avoid CamelCase.
Value -> value

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 07291ca90681..a3a85ad5c66e 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -49,12 +49,12 @@ static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
 	return RetSig;
 }
 
-static u8 odm_EVMdbToPercentage(s8 Value)
+static u8 odm_EVMdbToPercentage(s8 value)
 {
 	/*  -33dB~0dB to 0%~99% */
 	s8 ret_val;
 
-	ret_val = Value;
+	ret_val = value;
 
 	if (ret_val >= 0)
 		ret_val = 0;
-- 
2.19.0


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

* [PATCH 10/19] staging: rtl8188eu: rename odm_EVMdbToPercentage()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (7 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 09/19] staging: rtl8188eu: rename parameter of odm_EVMdbToPercentage() Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 11/19] staging: rtl8188eu: rename parameter of odm_SignalScaleMapping() Michael Straube
                   ` (9 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename odm_EVMdbToPercentage() to avoid CamelCase.
odm_EVMdbToPercentage -> odm_evm_db_to_percentage

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index a3a85ad5c66e..6d7c379c4444 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -49,7 +49,7 @@ static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
 	return RetSig;
 }
 
-static u8 odm_EVMdbToPercentage(s8 value)
+static u8 odm_evm_db_to_percentage(s8 value)
 {
 	/*  -33dB~0dB to 0%~99% */
 	s8 ret_val;
@@ -231,7 +231,7 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 			/*  Do not use shift operation like "rx_evmX >>= 1" because the compilor of free build environment */
 			/*  fill most significant bit to "zero" when doing shifting operation which may change a negative */
 			/*  value to positive one, then the dbm value (which is supposed to be negative)  is not correct anymore. */
-			EVM = odm_EVMdbToPercentage((pPhyStaRpt->stream_rxevm[i]));	/* dbm */
+			EVM = odm_evm_db_to_percentage((pPhyStaRpt->stream_rxevm[i]));	/* dbm */
 
 			if (pPktinfo->bPacketMatchBSSID) {
 				if (i == RF_PATH_A) /*  Fill value in RFD, Get the first spatial stream only */
-- 
2.19.0


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

* [PATCH 11/19] staging: rtl8188eu: rename parameter of odm_SignalScaleMapping()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (8 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 10/19] staging: rtl8188eu: rename odm_EVMdbToPercentage() Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 12/19] staging: rtl8188eu: rename variable in odm_SignalScaleMapping() Michael Straube
                   ` (8 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename parameter of odm_SignalScaleMapping() to avoid CamelCase.
CurrSig -> currsig

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 31 ++++++++++----------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 6d7c379c4444..25a6531ddf02 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -26,26 +26,27 @@ static u8 odm_query_rxpwrpercentage(s8 antpower)
 
 /*  2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. */
 /*  IF other SW team do not support the feature, remove this section.?? */
-static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 CurrSig)
+static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 currsig)
 {
 	s32 RetSig = 0;
 
-	if (CurrSig >= 51 && CurrSig <= 100)
+	if (currsig >= 51 && currsig <= 100)
 		RetSig = 100;
-	else if (CurrSig >= 41 && CurrSig <= 50)
-		RetSig = 80 + ((CurrSig - 40) * 2);
-	else if (CurrSig >= 31 && CurrSig <= 40)
-		RetSig = 66 + (CurrSig - 30);
-	else if (CurrSig >= 21 && CurrSig <= 30)
-		RetSig = 54 + (CurrSig - 20);
-	else if (CurrSig >= 10 && CurrSig <= 20)
-		RetSig = 42 + (((CurrSig - 10) * 2) / 3);
-	else if (CurrSig >= 5 && CurrSig <= 9)
-		RetSig = 22 + (((CurrSig - 5) * 3) / 2);
-	else if (CurrSig >= 1 && CurrSig <= 4)
-		RetSig = 6 + (((CurrSig - 1) * 3) / 2);
+	else if (currsig >= 41 && currsig <= 50)
+		RetSig = 80 + ((currsig - 40) * 2);
+	else if (currsig >= 31 && currsig <= 40)
+		RetSig = 66 + (currsig - 30);
+	else if (currsig >= 21 && currsig <= 30)
+		RetSig = 54 + (currsig - 20);
+	else if (currsig >= 10 && currsig <= 20)
+		RetSig = 42 + (((currsig - 10) * 2) / 3);
+	else if (currsig >= 5 && currsig <= 9)
+		RetSig = 22 + (((currsig - 5) * 3) / 2);
+	else if (currsig >= 1 && currsig <= 4)
+		RetSig = 6 + (((currsig - 1) * 3) / 2);
 	else
-		RetSig = CurrSig;
+		RetSig = currsig;
+
 	return RetSig;
 }
 
-- 
2.19.0


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

* [PATCH 12/19] staging: rtl8188eu: rename variable in odm_SignalScaleMapping()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (9 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 11/19] staging: rtl8188eu: rename parameter of odm_SignalScaleMapping() Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 13/19] staging: rtl8188eu: rename odm_SignalScaleMapping() Michael Straube
                   ` (7 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename variable in odm_SignalScaleMapping() to avoid CamelCase.
RetSig -> retsig

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 25a6531ddf02..498785d32a0b 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -28,26 +28,26 @@ static u8 odm_query_rxpwrpercentage(s8 antpower)
 /*  IF other SW team do not support the feature, remove this section.?? */
 static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 currsig)
 {
-	s32 RetSig = 0;
+	s32 retsig = 0;
 
 	if (currsig >= 51 && currsig <= 100)
-		RetSig = 100;
+		retsig = 100;
 	else if (currsig >= 41 && currsig <= 50)
-		RetSig = 80 + ((currsig - 40) * 2);
+		retsig = 80 + ((currsig - 40) * 2);
 	else if (currsig >= 31 && currsig <= 40)
-		RetSig = 66 + (currsig - 30);
+		retsig = 66 + (currsig - 30);
 	else if (currsig >= 21 && currsig <= 30)
-		RetSig = 54 + (currsig - 20);
+		retsig = 54 + (currsig - 20);
 	else if (currsig >= 10 && currsig <= 20)
-		RetSig = 42 + (((currsig - 10) * 2) / 3);
+		retsig = 42 + (((currsig - 10) * 2) / 3);
 	else if (currsig >= 5 && currsig <= 9)
-		RetSig = 22 + (((currsig - 5) * 3) / 2);
+		retsig = 22 + (((currsig - 5) * 3) / 2);
 	else if (currsig >= 1 && currsig <= 4)
-		RetSig = 6 + (((currsig - 1) * 3) / 2);
+		retsig = 6 + (((currsig - 1) * 3) / 2);
 	else
-		RetSig = currsig;
+		retsig = currsig;
 
-	return RetSig;
+	return retsig;
 }
 
 static u8 odm_evm_db_to_percentage(s8 value)
-- 
2.19.0


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

* [PATCH 13/19] staging: rtl8188eu: rename odm_SignalScaleMapping()
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (10 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 12/19] staging: rtl8188eu: rename variable in odm_SignalScaleMapping() Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 14/19] staging: rtl8188eu: correct block comment in bb_cfg.c Michael Straube
                   ` (6 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Rename odm_SignalScaleMapping to avoid CamelCase.
odm_SignalScaleMapping -> odm_signal_scale_mapping

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_hwconfig.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
index 498785d32a0b..82d6b2e18b29 100644
--- a/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
+++ b/drivers/staging/rtl8188eu/hal/odm_hwconfig.c
@@ -26,7 +26,7 @@ static u8 odm_query_rxpwrpercentage(s8 antpower)
 
 /*  2012/01/12 MH MOve some signal strength smooth method to MP HAL layer. */
 /*  IF other SW team do not support the feature, remove this section.?? */
-static s32 odm_SignalScaleMapping(struct odm_dm_struct *dm_odm, s32 currsig)
+static s32 odm_signal_scale_mapping(struct odm_dm_struct *dm_odm, s32 currsig)
 {
 	s32 retsig = 0;
 
@@ -244,10 +244,10 @@ static void odm_RxPhyStatus92CSeries_Parsing(struct odm_dm_struct *dm_odm,
 	/* UI BSS List signal strength(in percentage), make it good looking, from 0~100. */
 	/* It is assigned to the BSS List in GetValueFromBeaconOrProbeRsp(). */
 	if (isCCKrate) {
-		pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(dm_odm, PWDB_ALL));/* PWDB_ALL; */
+		pPhyInfo->SignalStrength = (u8)(odm_signal_scale_mapping(dm_odm, PWDB_ALL));/* PWDB_ALL; */
 	} else {
 		if (rf_rx_num != 0)
-			pPhyInfo->SignalStrength = (u8)(odm_SignalScaleMapping(dm_odm, total_rssi /= rf_rx_num));
+			pPhyInfo->SignalStrength = (u8)(odm_signal_scale_mapping(dm_odm, total_rssi /= rf_rx_num));
 	}
 
 	/* For 92C/92D HW (Hybrid) Antenna Diversity */
-- 
2.19.0


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

* [PATCH 14/19] staging: rtl8188eu: correct block comment in bb_cfg.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (11 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 13/19] staging: rtl8188eu: rename odm_SignalScaleMapping() Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 15/19] staging: rtl8188eu: simplify block comment in pwrseq.c Michael Straube
                   ` (5 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Correct block comment to clear a checkpatch warning.
WARNING: Block comments should align the * on each line

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/bb_cfg.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 1862c1396c85..11e0bb9c67d7 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -1,9 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0
 /******************************************************************************
-*
-* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
-*
-******************************************************************************/
+ *
+ * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
+ *
+ ******************************************************************************/
 
 #include "odm_precomp.h"
 
-- 
2.19.0


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

* [PATCH 15/19] staging: rtl8188eu: simplify block comment in pwrseq.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (12 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 14/19] staging: rtl8188eu: correct block comment in bb_cfg.c Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 16/19] staging: rtl8188eu: add spaces around '+' in fw.c Michael Straube
                   ` (4 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Simplify block comment to a single line to clear a checkpatch warning.
WARNING: Block comments use * on subsequent lines

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/pwrseq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/pwrseq.c b/drivers/staging/rtl8188eu/hal/pwrseq.c
index 4aa1dec0b5e4..f7890a8f4673 100644
--- a/drivers/staging/rtl8188eu/hal/pwrseq.c
+++ b/drivers/staging/rtl8188eu/hal/pwrseq.c
@@ -8,9 +8,8 @@
 #include "pwrseq.h"
 #include <rtl8188e_hal.h>
 
-/*
-    drivers should parse below arrays and do the corresponding actions
-*/
+/* drivers should parse below arrays and do the corresponding actions */
+
 /* 3 Power on  Array */
 struct wl_pwr_cfg rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS +
 					 RTL8188E_TRANS_END_STEPS] = {
-- 
2.19.0


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

* [PATCH 16/19] staging: rtl8188eu: add spaces around '+' in fw.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (13 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 15/19] staging: rtl8188eu: simplify block comment in pwrseq.c Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 17/19] staging: rtl8188eu: remove unnecessary parentheses in odm_rtl8188e.c Michael Straube
                   ` (3 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Add spaces around '+' in fw.c to follow kernel coding style.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/fw.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c
index 1b8341f40995..486ee4bd4744 100644
--- a/drivers/staging/rtl8188eu/hal/fw.c
+++ b/drivers/staging/rtl8188eu/hal/fw.c
@@ -98,9 +98,9 @@ static void rtl88e_firmware_selfreset(struct adapter *adapt)
 {
 	u8 u1b_tmp;
 
-	u1b_tmp = usb_read8(adapt, REG_SYS_FUNC_EN+1);
-	usb_write8(adapt, REG_SYS_FUNC_EN+1, (u1b_tmp & (~BIT(2))));
-	usb_write8(adapt, REG_SYS_FUNC_EN+1, (u1b_tmp | BIT(2)));
+	u1b_tmp = usb_read8(adapt, REG_SYS_FUNC_EN + 1);
+	usb_write8(adapt, REG_SYS_FUNC_EN + 1, (u1b_tmp & (~BIT(2))));
+	usb_write8(adapt, REG_SYS_FUNC_EN + 1, (u1b_tmp | BIT(2)));
 }
 
 static int _rtl88e_fw_free_to_go(struct adapter *adapt)
-- 
2.19.0


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

* [PATCH 17/19] staging: rtl8188eu: remove unnecessary parentheses in odm_rtl8188e.c
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (14 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 16/19] staging: rtl8188eu: add spaces around '+' in fw.c Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 18/19] staging: rtl8188eu: remove braces from single if statement Michael Straube
                   ` (2 subsequent siblings)
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove unnecessary parentheses in odm_rtl8188e.c.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_rtl8188e.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c b/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
index d5001920f77c..f42668eb37e4 100644
--- a/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
+++ b/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
@@ -13,7 +13,7 @@ static void dm_rx_hw_antena_div_init(struct odm_dm_struct *dm_odm)
 	struct adapter *adapter = dm_odm->Adapter;
 	u32 value32;
 
-	if (*(dm_odm->mp_mode) == 1) {
+	if (*dm_odm->mp_mode == 1) {
 		dm_odm->AntDivType = CGCS_RX_SW_ANTDIV;
 		phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT(7), 0);
 		phy_set_bb_reg(adapter, ODM_REG_LNA_SWITCH_11N, BIT(31), 1);
@@ -44,7 +44,7 @@ static void dm_trx_hw_antenna_div_init(struct odm_dm_struct *dm_odm)
 	struct adapter *adapter = dm_odm->Adapter;
 	u32	value32;
 
-	if (*(dm_odm->mp_mode) == 1) {
+	if (*dm_odm->mp_mode == 1) {
 		dm_odm->AntDivType = CGCS_RX_SW_ANTDIV;
 		phy_set_bb_reg(adapter, ODM_REG_IGI_A_11N, BIT(7), 0);
 		phy_set_bb_reg(adapter, ODM_REG_RX_ANT_CTRL_11N,
@@ -90,7 +90,7 @@ static void dm_fast_training_init(struct odm_dm_struct *dm_odm)
 	struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
 	u32 AntCombination = 2;
 
-	if (*(dm_odm->mp_mode) == 1) {
+	if (*dm_odm->mp_mode == 1) {
 		return;
 	}
 
-- 
2.19.0


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

* [PATCH 18/19] staging: rtl8188eu: remove braces from single if statement
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (15 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 17/19] staging: rtl8188eu: remove unnecessary parentheses in odm_rtl8188e.c Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 19:53 ` [PATCH 19/19] staging: rtl8188eu: fix spelling mistake in comment Michael Straube
  2018-09-30 20:30 ` [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Joe Perches
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Remove braces from single line if statement.
Reported by checkpatch.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_rtl8188e.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c b/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
index f42668eb37e4..9f674bac3b96 100644
--- a/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
+++ b/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
@@ -90,9 +90,8 @@ static void dm_fast_training_init(struct odm_dm_struct *dm_odm)
 	struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
 	u32 AntCombination = 2;
 
-	if (*dm_odm->mp_mode == 1) {
+	if (*dm_odm->mp_mode == 1)
 		return;
-	}
 
 	for (i = 0; i < 6; i++) {
 		dm_fat_tbl->Bssid[i] = 0;
-- 
2.19.0


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

* [PATCH 19/19] staging: rtl8188eu: fix spelling mistake in comment
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (16 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 18/19] staging: rtl8188eu: remove braces from single if statement Michael Straube
@ 2018-09-30 19:53 ` Michael Straube
  2018-09-30 20:30 ` [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Joe Perches
  18 siblings, 0 replies; 21+ messages in thread
From: Michael Straube @ 2018-09-30 19:53 UTC (permalink / raw)
  To: gregkh; +Cc: devel, linux-kernel, Michael Straube

Fix a spelling mistake reported by checkpatch.
Caculate -> Calculate

Signed-off-by: Michael Straube <straube.linux@gmail.com>
---
 drivers/staging/rtl8188eu/hal/odm_rtl8188e.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c b/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
index 9f674bac3b96..3fb0ed604e3e 100644
--- a/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
+++ b/drivers/staging/rtl8188eu/hal/odm_rtl8188e.c
@@ -272,7 +272,7 @@ static void rtl88eu_dm_hw_ant_div(struct odm_dm_struct *dm_odm)
 	for (i = 0; i < ODM_ASSOCIATE_ENTRY_NUM; i++) {
 		entry = dm_odm->pODM_StaInfo[i];
 		if (IS_STA_VALID(entry)) {
-			/* 2 Caculate RSSI per Antenna */
+			/* 2 Calculate RSSI per Antenna */
 			main_rssi = (dm_fat_tbl->MainAnt_Cnt[i] != 0) ?
 				     (dm_fat_tbl->MainAnt_Sum[i]/dm_fat_tbl->MainAnt_Cnt[i]) : 0;
 			aux_rssi = (dm_fat_tbl->AuxAnt_Cnt[i] != 0) ?
-- 
2.19.0


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

* Re: [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting
  2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
                   ` (17 preceding siblings ...)
  2018-09-30 19:53 ` [PATCH 19/19] staging: rtl8188eu: fix spelling mistake in comment Michael Straube
@ 2018-09-30 20:30 ` Joe Perches
  2018-10-01  5:12   ` Dan Carpenter
  18 siblings, 1 reply; 21+ messages in thread
From: Joe Perches @ 2018-09-30 20:30 UTC (permalink / raw)
  To: Michael Straube, gregkh, Dan Carpenter; +Cc: devel, linux-kernel

On Sun, 2018-09-30 at 21:52 +0200, Michael Straube wrote:
> Cleanup all inconsistent indenting reported by smatch.

There are also some others like:

drivers/staging/rtl8188eu/core/rtw_mlme.c:1752: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 24)
1750:	if ((ndisauthmode == Ndis802_11AuthModeWPA) ||
1751:	    (ndisauthmode == Ndis802_11AuthModeWPAPSK))
1752:			authmode = _WPA_IE_ID_;

Perhaps smatch can be enhanced to find those too.



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

* Re: [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting
  2018-09-30 20:30 ` [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Joe Perches
@ 2018-10-01  5:12   ` Dan Carpenter
  0 siblings, 0 replies; 21+ messages in thread
From: Dan Carpenter @ 2018-10-01  5:12 UTC (permalink / raw)
  To: Joe Perches; +Cc: Michael Straube, gregkh, devel, linux-kernel

On Sun, Sep 30, 2018 at 01:30:11PM -0700, Joe Perches wrote:
> On Sun, 2018-09-30 at 21:52 +0200, Michael Straube wrote:
> > Cleanup all inconsistent indenting reported by smatch.
> 
> There are also some others like:
> 
> drivers/staging/rtl8188eu/core/rtw_mlme.c:1752: WARNING:SUSPECT_CODE_INDENT: suspect code indent for conditional statements (8, 24)
> 1750:	if ((ndisauthmode == Ndis802_11AuthModeWPA) ||
> 1751:	    (ndisauthmode == Ndis802_11AuthModeWPAPSK))
> 1752:			authmode = _WPA_IE_ID_;
> 
> Perhaps smatch can be enhanced to find those too.
> 

Style issues are not something I want to get into...  I had hoped that
this test would find bugs, because stuff like this looks so suspicious:

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 20f34d25c369..5c4ff81987bd 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -246,7 +246,7 @@ int rtw_generate_ie(struct registry_priv *pregistrypriv)
                wireless_mode = pregistrypriv->wireless_mode;
        }

-               rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);
+       rtw_set_supported_rate(pdev_network->SupportedRates, wireless_mode);

        rateLen = rtw_get_rateset_len(pdev_network->SupportedRates);

But I've never found even one bug with the inconsistent indenting
check.  The other related test about missing curly braces is pretty
useful though.

regards,
dan carpenter


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

end of thread, other threads:[~2018-10-01  5:12 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-30 19:52 [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Michael Straube
2018-09-30 19:52 ` [PATCH 02/19] staging: rtl8188eu: rename odm_HWConfig Michael Straube
2018-09-30 19:52 ` [PATCH 03/19] staging: rtl8188eu: remove wrapper odm_SignalScaleMapping() Michael Straube
2018-09-30 19:52 ` [PATCH 04/19] staging: rtl8188eu: add spaces around '+' in odm_hwconfig.c Michael Straube
2018-09-30 19:52 ` [PATCH 05/19] staging: rtl8188eu: add spaces around '*' " Michael Straube
2018-09-30 19:52 ` [PATCH 06/19] staging: rtl8188eu: replace tabs with spaces " Michael Straube
2018-09-30 19:52 ` [PATCH 07/19] staging: rtl8188eu: rename parameter of odm_QueryRxPwrPercentage() Michael Straube
2018-09-30 19:52 ` [PATCH 08/19] staging: rtl8188eu: rename odm_QueryRxPwrPercentage() Michael Straube
2018-09-30 19:53 ` [PATCH 09/19] staging: rtl8188eu: rename parameter of odm_EVMdbToPercentage() Michael Straube
2018-09-30 19:53 ` [PATCH 10/19] staging: rtl8188eu: rename odm_EVMdbToPercentage() Michael Straube
2018-09-30 19:53 ` [PATCH 11/19] staging: rtl8188eu: rename parameter of odm_SignalScaleMapping() Michael Straube
2018-09-30 19:53 ` [PATCH 12/19] staging: rtl8188eu: rename variable in odm_SignalScaleMapping() Michael Straube
2018-09-30 19:53 ` [PATCH 13/19] staging: rtl8188eu: rename odm_SignalScaleMapping() Michael Straube
2018-09-30 19:53 ` [PATCH 14/19] staging: rtl8188eu: correct block comment in bb_cfg.c Michael Straube
2018-09-30 19:53 ` [PATCH 15/19] staging: rtl8188eu: simplify block comment in pwrseq.c Michael Straube
2018-09-30 19:53 ` [PATCH 16/19] staging: rtl8188eu: add spaces around '+' in fw.c Michael Straube
2018-09-30 19:53 ` [PATCH 17/19] staging: rtl8188eu: remove unnecessary parentheses in odm_rtl8188e.c Michael Straube
2018-09-30 19:53 ` [PATCH 18/19] staging: rtl8188eu: remove braces from single if statement Michael Straube
2018-09-30 19:53 ` [PATCH 19/19] staging: rtl8188eu: fix spelling mistake in comment Michael Straube
2018-09-30 20:30 ` [PATCH 01/19] staging: rtl8188eu: cleanup inconsistent indenting Joe Perches
2018-10-01  5:12   ` Dan Carpenter

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).