From patchwork Wed Mar 11 20:03:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 5988561 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3B6B59F380 for ; Wed, 11 Mar 2015 20:04:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B4F42037C for ; Wed, 11 Mar 2015 20:04:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F32920117 for ; Wed, 11 Mar 2015 20:04:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752685AbbCKUDx (ORCPT ); Wed, 11 Mar 2015 16:03:53 -0400 Received: from plaes.org ([188.166.43.21]:51920 "EHLO plaes.org" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752663AbbCKUDv (ORCPT ); Wed, 11 Mar 2015 16:03:51 -0400 Received: from localhost (AMontsouris-159-1-45-92.w90-46.abo.wanadoo.fr [90.46.252.92]) by plaes.org (Postfix) with ESMTPSA id 90BE0408FC; Wed, 11 Mar 2015 20:03:49 +0000 (UTC) From: Priit Laes To: Kalle Valo Cc: Larry Finger , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Chaoming Li , Priit Laes Subject: [PATCH 6/6] rtlwifi: Rename rtl_translate_todbm to rtl_signalpower_todbm Date: Wed, 11 Mar 2015 22:03:29 +0200 Message-Id: <1426104209-6913-7-git-send-email-plaes@plaes.org> X-Mailer: git-send-email 2.3.1 In-Reply-To: <1426104209-6913-1-git-send-email-plaes@plaes.org> References: <1426104209-6913-1-git-send-email-plaes@plaes.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Priit Laes --- 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)