From 6b8b810f2c9a11e65bcd7674b1593cda503a7a6b Mon Sep 17 00:00:00 2001 From: Luca Ceresoli Date: Fri, 30 Dec 2016 00:01:06 +0100 Subject: [PATCH] staging: rtl8188eu: remove unused members from struct recv_priv Since commit da25a8ec6b2d ("staging: rtl8188eu: remove unused debugging functions") is_signal_dbg is never set to true, so the code under if (adapter->recvpriv.is_signal_dbg) is dead. Remove the variable and the dead code. The signal_strength_dbg was referenced only in the code that is being removed, so remove it as well. Also fix coding style issues in the touched lines. Cc: Greg Kroah-Hartman Cc: Larry Finger Cc: Ivan Safonov Cc: devel@driverdev.osuosl.org Signed-off-by: Luca Ceresoli Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8188eu/core/rtw_recv.c | 75 +++++++++++++++------------- drivers/staging/rtl8188eu/include/rtw_recv.h | 2 - 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b/drivers/staging/rtl8188eu/core/rtw_recv.c index 301285a..bb0844d 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -2071,45 +2071,48 @@ static void rtw_signal_stat_timer_hdl(unsigned long data) u8 avg_signal_qual = 0; u8 _alpha = 3; /* this value is based on converging_constant = 5000 and sampling_interval = 1000 */ - if (adapter->recvpriv.is_signal_dbg) { - /* update the user specific value, signal_strength_dbg, to signal_strength, rssi */ - adapter->recvpriv.signal_strength = adapter->recvpriv.signal_strength_dbg; - adapter->recvpriv.rssi = (s8)translate_percentage_to_dbm((u8)adapter->recvpriv.signal_strength_dbg); - } else { - if (recvpriv->signal_strength_data.update_req == 0) {/* update_req is clear, means we got rx */ - avg_signal_strength = recvpriv->signal_strength_data.avg_val; - /* after avg_vals are acquired, we can re-stat the signal values */ - recvpriv->signal_strength_data.update_req = 1; - } - - if (recvpriv->signal_qual_data.update_req == 0) {/* update_req is clear, means we got rx */ - avg_signal_qual = recvpriv->signal_qual_data.avg_val; - /* after avg_vals are acquired, we can re-stat the signal values */ - recvpriv->signal_qual_data.update_req = 1; - } + if (recvpriv->signal_strength_data.update_req == 0) { + /* update_req is clear, means we got rx */ + avg_signal_strength = recvpriv->signal_strength_data.avg_val; + /* after avg_vals are acquired, we can re-stat the signal + * values + */ + recvpriv->signal_strength_data.update_req = 1; + } - /* update value of signal_strength, rssi, signal_qual */ - if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == false) { - tmp_s = avg_signal_strength+(_alpha-1)*recvpriv->signal_strength; - if (tmp_s % _alpha) - tmp_s = tmp_s/_alpha + 1; - else - tmp_s = tmp_s/_alpha; - if (tmp_s > 100) - tmp_s = 100; + if (recvpriv->signal_qual_data.update_req == 0) { + /* update_req is clear, means we got rx */ + avg_signal_qual = recvpriv->signal_qual_data.avg_val; + /* after avg_vals are acquired, we can re-stat the signal + * values + */ + recvpriv->signal_qual_data.update_req = 1; + } - tmp_q = avg_signal_qual+(_alpha-1)*recvpriv->signal_qual; - if (tmp_q % _alpha) - tmp_q = tmp_q/_alpha + 1; - else - tmp_q = tmp_q/_alpha; - if (tmp_q > 100) - tmp_q = 100; + /* update value of signal_strength, rssi, signal_qual */ + if (check_fwstate(&adapter->mlmepriv, _FW_UNDER_SURVEY) == false) { + tmp_s = avg_signal_strength + + (_alpha - 1) * recvpriv->signal_strength; + if (tmp_s % _alpha) + tmp_s = tmp_s / _alpha + 1; + else + tmp_s = tmp_s / _alpha; + if (tmp_s > 100) + tmp_s = 100; + + tmp_q = avg_signal_qual + + (_alpha - 1) * recvpriv->signal_qual; + if (tmp_q % _alpha) + tmp_q = tmp_q / _alpha + 1; + else + tmp_q = tmp_q / _alpha; + if (tmp_q > 100) + tmp_q = 100; - recvpriv->signal_strength = tmp_s; - recvpriv->rssi = (s8)translate_percentage_to_dbm(tmp_s); - recvpriv->signal_qual = tmp_q; - } + recvpriv->signal_strength = tmp_s; + recvpriv->rssi = (s8)translate_percentage_to_dbm(tmp_s); + recvpriv->signal_qual = tmp_q; } + rtw_set_signal_stat_timer(recvpriv); } diff --git a/drivers/staging/rtl8188eu/include/rtw_recv.h b/drivers/staging/rtl8188eu/include/rtw_recv.h index 052af7b..2a92162 100644 --- a/drivers/staging/rtl8188eu/include/rtw_recv.h +++ b/drivers/staging/rtl8188eu/include/rtw_recv.h @@ -179,8 +179,6 @@ struct recv_priv { struct recv_buf *precv_buf; /* 4 alignment */ struct __queue free_recv_buf_queue; /* For display the phy informatiom */ - u8 is_signal_dbg; /* for debug */ - u8 signal_strength_dbg; /* for debug */ s8 rssi; s8 rxpwdb; u8 signal_strength; -- 2.7.4