lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1426104209-6913-7-git-send-email-plaes@plaes.org>
Date:	Wed, 11 Mar 2015 22:03:29 +0200
From:	Priit Laes <plaes@...es.org>
To:	Kalle Valo <kvalo@...eaurora.org>
Cc:	Larry Finger <Larry.Finger@...inger.net>,
	linux-wireless@...r.kernel.org, netdev@...r.kernel.org,
	Chaoming Li <chaoming_li@...lsil.com.cn>,
	Priit Laes <plaes@...es.org>
Subject: [PATCH 6/6] rtlwifi: Rename rtl_translate_todbm to rtl_signalpower_todbm

Signed-off-by: Priit Laes <plaes@...es.org>
---
 drivers/net/wireless/rtlwifi/stats.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/stats.c b/drivers/net/wireless/rtlwifi/stats.c
index c702d01..4739324 100644
--- a/drivers/net/wireless/rtlwifi/stats.c
+++ b/drivers/net/wireless/rtlwifi/stats.c
@@ -48,14 +48,9 @@ u8 rtl_evm_db_to_percentage(char value)
 }
 EXPORT_SYMBOL(rtl_evm_db_to_percentage);
 
-static long rtl_translate_todbm(struct ieee80211_hw *hw,
-			 u8 signal_strength_index)
+static long rtl_signalpower_todbm(u8 signal_strength_index)
 {
-	long signal_power;
-
-	signal_power = (long)((signal_strength_index + 1) >> 1);
-	signal_power -= 95;
-	return signal_power;
+	return (long)((signal_strength_index + 1) >> 1) - 95;
 }
 
 long rtl_signal_scale_mapping(long currsig)
@@ -93,7 +88,7 @@ static void rtl_process_ui_rssi(struct ieee80211_hw *hw,
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct rtl_phy *rtlphy = &(rtlpriv->phy);
 	u8 rfpath;
-	u32 last_rssi, tmpval;
+	u32 last_rssi;
 
 	if (!pstatus->packet_toself && !pstatus->packet_beacon)
 		return;
@@ -112,10 +107,9 @@ static void rtl_process_ui_rssi(struct ieee80211_hw *hw,
 	    pstatus->signalstrength;
 	if (rtlpriv->stats.ui_rssi.index >= PHY_RSSI_SLID_WIN_MAX)
 		rtlpriv->stats.ui_rssi.index = 0;
-	tmpval = rtlpriv->stats.ui_rssi.total_val /
-		rtlpriv->stats.ui_rssi.total_num;
-	rtlpriv->stats.signal_strength = rtl_translate_todbm(hw,
-		(u8) tmpval);
+	rtlpriv->stats.signal_strength = rtl_signalpower_todbm(
+		(u8)rtlpriv->stats.ui_rssi.total_val /
+			rtlpriv->stats.ui_rssi.total_num);
 	pstatus->rssi = rtlpriv->stats.signal_strength;
 
 	if (pstatus->is_cck)
-- 
2.3.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ