From patchwork Thu May 5 15:08:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wang yanqing X-Patchwork-Id: 9025161 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 91AF7BF440 for ; Thu, 5 May 2016 15:09:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C2462201CD for ; Thu, 5 May 2016 15:09:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF00A20220 for ; Thu, 5 May 2016 15:09:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757430AbcEEPJQ (ORCPT ); Thu, 5 May 2016 11:09:16 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:34671 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937AbcEEPJM (ORCPT ); Thu, 5 May 2016 11:09:12 -0400 Received: by mail-pf0-f194.google.com with SMTP id 145so8275496pfz.1; Thu, 05 May 2016 08:09:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=dK2SK6/XfN4V+9gEEwcwBW2HW3Q2PKX54UThBxkEzac=; b=DeLqxgJc9Zg57DJe1sB0SMd+AeC8OJigasCWS8DMA17xlSNn3Vc0d9s2LUOzWj/vnd eHuldtPCZh47jae3S+ABumnDdptEMaUF4mC5knOlDvyxsHFIslYWbHfTiI41HekAuu/t 8U7WptkDj7LODVcKFfaxMLsWPN0m5fYKJrrDVMqLNfZ6Mq717neppEBa5+VKvMvVSHeA 7//wEdDMT71wKaw+3jk3kNXUb0kFfkTy8Zu0W/XX8MsMlWpaySDtm3E/7P/nrDHU+4xG pGXfhPnG9IKy2n2+HYxO9RkcYTZUCDto2SEseKfEgCBLyBk+mv9pJbEZxajH30mKe/T7 NSBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=dK2SK6/XfN4V+9gEEwcwBW2HW3Q2PKX54UThBxkEzac=; b=dWR6Y/KE0HL/oRqF33HmyLzfwFbgSVbjsvPbDfEvNSr5vCEJ63LFY3u3lD4hRiPFbh QCAjn+iCiQIqvMHF84Q6ejwA61J0qmrrbGKnHB+kqus39IBV4+2syKX8n8swXTH2Yvjg e2ag50env9a0ac45EunEIi4jWB18XmfLPcOrl0wkm4VCGKx5FW81WM+bqpvSAzwilRGe fzUcuo8wr0BRGKBZB8Auf54J5Nx3pvE5OslaUf8486E0kMYcP9COD1aunL6ZnIc4iLQD Dd4xxgEVLCvN6zh9+KYhZrjzd+pfVp0ue5w5SDHpRqhw+4WRGQu0KXDbSYUxskJ0eGPz 4ZFg== X-Gm-Message-State: AOPr4FWQZByWkzaFMJU4vwveDgg5YNfMBCG5dH/I7b4TGlRESnGvX7Xtv8Hj/J7wipsOxQ== X-Received: by 10.98.25.74 with SMTP id 71mr21212718pfz.94.1462460951970; Thu, 05 May 2016 08:09:11 -0700 (PDT) Received: from udknight.localhost ([218.66.137.165]) by smtp.gmail.com with ESMTPSA id p80sm14455047pfj.58.2016.05.05.08.09.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 May 2016 08:09:11 -0700 (PDT) Received: from udknight.localhost (udknight.com [127.0.0.1]) by udknight.localhost (8.14.4/8.14.4) with ESMTP id u45F8rV5004193; Thu, 5 May 2016 23:08:58 +0800 Received: (from root@localhost) by udknight.localhost (8.14.4/8.14.4/Submit) id u45F8M9I004181; Thu, 5 May 2016 23:08:22 +0800 Date: Thu, 5 May 2016 23:08:22 +0800 From: Wang YanQing To: Larry.Finger@lwfinger.net Cc: chaoming_li@realsil.com.cn, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] rtlwifi: Remove double check for cnt_after_linked Message-ID: <20160505150822.GA4151@udknight> Mail-Followup-To: Wang YanQing , Larry.Finger@lwfinger.net, chaoming_li@realsil.com.cn, kvalo@codeaurora.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 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 --- Changes v1-v2: 1: rewrite subject and commit message. 2: fix issues report by checkpatch.pl. drivers/net/wireless/realtek/rtlwifi/ps.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/ps.c b/drivers/net/wireless/realtek/rtlwifi/ps.c index b69321d..93579ca 100644 --- a/drivers/net/wireless/realtek/rtlwifi/ps.c +++ b/drivers/net/wireless/realtek/rtlwifi/ps.c @@ -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);