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 <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Larry Finger <Larry.Finger@xxxxxxxxxxxx> Cc: Ivan Safonov <insafonov@xxxxxxxxx> Cc: devel@xxxxxxxxxxxxxxxxxxxx Signed-off-by: Luca Ceresoli <luca@xxxxxxxxxxxxxxxx> --- 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 3e6edb63d36b..f46e63e9e24b 100644 --- a/drivers/staging/rtl8188eu/core/rtw_recv.c +++ b/drivers/staging/rtl8188eu/core/rtw_recv.c @@ -2064,45 +2064,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 052af7b891da..2a9216224882 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 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel