Skip to content

Commit

Permalink
rtlwifi: Remove double check for cnt_after_linked
Browse files Browse the repository at this point in the history
rtl_lps_enter does two successive check for cnt_after_linked
to make sure some time has elapsed after linked. The second
check isn't necessary, because if cnt_after_linked is bigger
than 5, it is bigger than 2 of course!

This patch remove the second check code.

Signed-off-by: Wang YanQing <udknight@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
wyqkp authored and Kalle Valo committed May 11, 2016
1 parent 496aec5 commit 976aff5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions drivers/net/wireless/realtek/rtlwifi/ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,14 +443,10 @@ void rtl_lps_enter(struct ieee80211_hw *hw)

spin_lock_irqsave(&rtlpriv->locks.lps_lock, flag);

/* Idle for a while if we connect to AP a while ago. */
if (mac->cnt_after_linked >= 2) {
if (ppsc->dot11_psmode == EACTIVE) {
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
"Enter 802.11 power save mode...\n");

rtl_lps_set_psmode(hw, EAUTOPS);
}
if (ppsc->dot11_psmode == EACTIVE) {
RT_TRACE(rtlpriv, COMP_POWER, DBG_LOUD,
"Enter 802.11 power save mode...\n");
rtl_lps_set_psmode(hw, EAUTOPS);
}

spin_unlock_irqrestore(&rtlpriv->locks.lps_lock, flag);
Expand Down

0 comments on commit 976aff5

Please sign in to comment.