From patchwork Mon Nov 6 13:55:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118051 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2792121qgn; Mon, 6 Nov 2017 05:56:39 -0800 (PST) X-Google-Smtp-Source: ABhQp+SBKVYxdsn6HX1Rd9WfMGGd0xKKhzswKs3/gbUCwMAVw1ekqF7CmW0qPCRdO8BlBabCOR6h X-Received: by 10.99.95.86 with SMTP id t83mr15256177pgb.34.1509976598933; Mon, 06 Nov 2017 05:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509976598; cv=none; d=google.com; s=arc-20160816; b=bN2c0pzp3je6CKHsCcIKS7tNq3k7EahsYO5nN/HOv3YzCPjI5M6uJylVx3ciSVDdVf slqov0VsMU4mnN/sVA1p/PqQ6fAMEJdSaD1D5yHQlaMgWeVbWP39fr/KG1ZI1CuTUi5+ JdCLNf42z/tc8rlzG6LKSvzmic9lAwCc4OYJWn5g1OhA5PbChVdEFNHUNcG5H/ftcdVk 3Yk8ktlKROgn1n53NKxlQ0T4wmjiJUDvzNPrXyMXfRdtGlt9VskNMqr3ZU96ZxrIUxR+ 9xJAyUnTlXVTVSS8mzY8KTO5pq0ZX1tFTLQzfq26DC0PrDk2bS05uiB5rWiR9XyUoRFD aPvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=EiSUVmYa1CvhBrlokc6Hv66Xcln/Do0oT1bLzMTGeMs=; b=GEO+LhnUOCyuBTKdzxa3q1H4laJJzLw7dUKWp+mTiyfPTqmVF5dJkFdesH3uaT8U6u GcxfjpIp34JXlxiYvvOaiHbQgoyGetUQae2N+tuxdyfl51COdzHs1KAWldMmxi9lnOI7 Z08jjagb1n58yPxE+bRofyvNF/aUMWHuLEB3KBKOPbwDD+7BmPB6hHk4V3/6gAG/KfJr TlX82Lfr5Q5CX3zaF8uqLiDKSsSEtcUh3wA3dLPxPGqrLlqezaSgaAoYv1MWuaYbxGhB Ys4Ym6P/feF91Wl87lI1D3LOcIjH4xmP1EWn4A4QST8fq+Iin5APJjKGCRI2lpFBh42A WY0A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si9648164plo.514.2017.11.06.05.56.38; Mon, 06 Nov 2017 05:56:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753336AbdKFN4h (ORCPT + 26 others); Mon, 6 Nov 2017 08:56:37 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:64758 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbdKFN4f (ORCPT ); Mon, 6 Nov 2017 08:56:35 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0ML81x-1eBz0A1aUr-000Lbq; Mon, 06 Nov 2017 14:56:23 +0100 From: Arnd Bergmann To: Larry Finger , Chaoming Li , Kalle Valo Cc: Arnd Bergmann , stable@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] rtlwifi: fix uninitialized rtlhal->last_suspend_sec time Date: Mon, 6 Nov 2017 14:55:35 +0100 Message-Id: <20171106135619.1248453-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:aP6uiO1yp6DrgXYBztiOq1sOy5iRD4x14VRqlJZ1804TcbyvJnb sW4v5eozfeuhvmEuzgEi3wTQJaNBIOc264oFiX9PkqWkkQogxuPWUBqfNEMPqaxSBHTeebx wzU50U7nQLLbSWxvOnEvd6CfchRJf3btRGGWg7o6iWOgUIWOSH19N2ZBAwYC/8kK4lev0IP E01upb1UoY2VaXSft41JA== X-UI-Out-Filterresults: notjunk:1; V01:K0:J27OkW/uTvI=:zhWDkt8pyX0rS9vZemloKA P3K1d3DeHrmU7VwVJjPbJAgCtgmFP0CHLaOE4M0p7L40gkbT+pgA1bkp3/lw1Zp7Klfbhfzec WoSPf/8nSNPhO04jMnHEnelF9G2lAepjqyTJuksYCLCHu2dHt7DHJSG73TPLRzpOhWcYOVw0a Pbp/Psawp44vMK6H3G7+YIFqPSlJdnLODI4vlXs1WMabHEDdeBxiiz3mbL7I5fzDDIq5vm+t/ W77+0EWxplCctijZLa14WM6eW3gMZkzSsB3U3JbSR5MR90j4lvJt0KHHTqG/tRXDjR516PlyR GX8bSlTnuUEsUNEpxfoTaKyTO+RLDCtuA2WiGMJkoOF8YdXkPMN+rXVUopXuuAcY3WFPzfocx 3hvJ49MkiE1edaSvMWOwiEJ/QH0NAaA+NXv0303de1Ty8ROMO8tsU+0bqhPSzaIH/1POMEtZb jGL0MjexKdsfNL+za5s8NX1iU7q7T6QG6WZoQJeizMYZFlYuB5MrCwheKi7bnYm/QwgtwxpYa hFJWJCSaIjh1OYR1JV3eUnTEvQu2DsDSMyjB28jLF/HubOSs6dIs1PBRYZXkcCbfxt79kC79n p8GnMeOjEflGt6pKRLKUuwOdq2G3+N2DJpa+f0NC4V10VYcksP8JPHRcldrpdpQEcaquN+GoA GI1oLFtFSZ5/8D4X1Rk+E5aHt+3ehbfiFab31sysQhdAIkMAhG9Zk3XPku7dnBCROwI0/l2Xv FSuwrXIdhZHAIRIyqsMbjKYxAD5GMyfpeBJHzA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We set rtlhal->last_suspend_sec to an uninitialized stack variable, but unfortunately gcc never warned about this, I only found it while working on another patch. I opened a gcc bug for this. Presumably the value of rtlhal->last_suspend_sec is not all that important, but it does get used, so we probably want the patch backported to stable kernels. Cc: stable@vger.kernel.org Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82839 Signed-off-by: Arnd Bergmann --- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 + 1 file changed, 1 insertion(+) -- 2.9.0 Acked-by: Larry Finger diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index 60c82a5b51cd..20ffe856180e 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c @@ -1373,6 +1373,7 @@ static void _rtl8821ae_get_wakeup_reason(struct ieee80211_hw *hw) ppsc->wakeup_reason = 0; + do_gettimeofday(&ts); rtlhal->last_suspend_sec = ts.tv_sec; switch (fw_reason) { From patchwork Mon Nov 6 13:55:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118052 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2792611qgn; Mon, 6 Nov 2017 05:57:15 -0800 (PST) X-Google-Smtp-Source: ABhQp+ToRIqs8uq0Q+qvrvyPHzY3nkU/HIAB9fDEwSlxCElsBnEau0UNgAxmyeVy6UCImcUnWISG X-Received: by 10.101.80.136 with SMTP id r8mr15506409pgp.198.1509976634994; Mon, 06 Nov 2017 05:57:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509976634; cv=none; d=google.com; s=arc-20160816; b=VtlZFUHgbE4fcv55bZFAVY0uAGoTxtuRJ3/ZgK3VQHxsxCF/hlBXN2aM6UDsh7Kl1p t5CC1sr6tXEGqfeLsMHpGg0Gen9fTG/Ro13CSIrLiwVQn1wrKnYy9JNxSUiri9Jb873R nmClBJk60hE00I1M2sSyJ7th7/xMTAs18CK3CM033du0t2MUB0Vc6n3+npJAJSPG0hYu aqocJDo6LKDITeFY4slz9FR0n28dqVxBK/nSu0HASx3ZMBIvXvJbgF/83S63HDFcsdBy xSyn4hK61cEDOHUe4CePEOCufpAiqFp+BSvaLUjtdctSTSc4ZCdqts9wds3BwWs7+BVL nVIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=nzUFk2T61swbEyfWVRSXhm5m5eSDjvCwmIUD6m+kaIc=; b=vnPzYV0+OaF3HtSFWK5ieLUy9STjsaDBhTLDdowJ81MrbsfmFeXi6+sjw4drDkH4Pv olYI/zxAN2ZGGDZGQpAio+nggp5FrLJJ5Lh9P4Gx2Zxh81xnMpdCeZx86ugjkss1C2em MXnhSEpEmVUnpdypNnXU+tf6IXnxTuXYrcD6EU6uWNE3jeKRggLjBt7aD2Hlt5gD5UWJ VbTI8h40E/XOo9Sy4eFAFHxh7QJbqO6ZpwzA4MboGnMR//Zt0Xjs8v/ndEMaeGtG8IgW xM+wjt4IiNJpIrO5vl9Orc7lf2x3XqiWd4f61wHx0/RK0DLWSK91YroqLcc8HPexMCSm Bszw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si9648164plo.514.2017.11.06.05.57.14; Mon, 06 Nov 2017 05:57:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753383AbdKFN5N (ORCPT + 26 others); Mon, 6 Nov 2017 08:57:13 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:52194 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752800AbdKFN5L (ORCPT ); Mon, 6 Nov 2017 08:57:11 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MUEy2-1ecYAb45cw-00QzOf; Mon, 06 Nov 2017 14:57:00 +0100 From: Arnd Bergmann To: Larry Finger , Chaoming Li , Kalle Valo Cc: Arnd Bergmann , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] rtlwifi: use ktime_get_real_seconds() for suspend time Date: Mon, 6 Nov 2017 14:55:36 +0100 Message-Id: <20171106135619.1248453-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171106135619.1248453-1-arnd@arndb.de> References: <20171106135619.1248453-1-arnd@arndb.de> X-Provags-ID: V03:K0:wxxxLqazar6pcznhhWczkuLS0VII+zs+DMwJ78OnOb/Slq1HBUr kGCXcdSjX43QglNZi3D1WyfoSuUHd3LiIrfU0FuNAhWAFC25M1RDXJ2G8Mh5BcN3kLBv0ez Dv4HVeKbwu5FzXRzbN9JvHUtFuobZ/eEJhQGB8NjFTpNL4h39c6LBVnO/2Q2YbeaaSD9Lwi bmM/ORy0AucjHSYtYDygA== X-UI-Out-Filterresults: notjunk:1; V01:K0:XIdAaSudI/8=:zS6F3iIFpJYzrhUOacMnc6 SvuzAFxNtk8oTmnQgUYOeEbVLFY5l0z6EvMKmJulSISv0MGqt1zZyWgnG/9DF+bkJbaJZ6PJl dmBi0PjG7MSML4gZESKpE/w/hMc7BFuAJ5/fgrCl6PuTg4SgOkq9OtPBkagzeGYIxfoTCGrdw QbXZGEcdPXTtOVH7KbyLYXjgTMMU50/yaUcwZpG25gkaVpl2OyJdSYXKHWSP9OV2y4Swtx7to fnYywD8PAiJmkZQoHa5NQt1xQBZZfJio3hm2FaZvvT3M56cJrKvQ+plNf56qgRO7N8rV5HBVv i/Lvu7RpRbZDBHw92opXh9X3KpJjpHAqiGH/C3kR3RVbYt9Ik1L+pee4eNNE4l0aH2EaE+n7t Lz6ARGcVPiDfTnt2xzIzWjVaqVHUlsu7iNp81IvmEE35oj480CXgs3E+CmySj0LQA6HhJ1Yf3 SfNkuhnt1q8Y7mIL5uUwM8iUdJ4fstnOCyq3Dr7xauxqQOJQvBNt7pUiAW9oWiDGUZPtVB5Yz EOvP6Q2O2FjW8DWL9NCaDl7bNR8Pk8aALOE7l4z9jyoK4peBwlVfeDR1/lTnfNX7DzJ/XZFvT mz86A8Yv/fr/PZ1Qk7XHSClCN3SdCC3fkY8T1DUbpbtF5ZnZCEqAmB4m/dNG6VCQ6R5Icawn7 U7q9IQyK5cIkczPP3QZACsVWw6NhWDmcyk++LDr9G5ZVp12onO4J1s+5mlxLK1EXWOKJTUGLu rk1mwsCK8i6BJPFqdEKmRY41nYpG106Fq30NPw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org do_gettimeofday() is deprecated and slower than necessary for the purpose of reading the seconds. This changes rtl_op_suspend/resume to use ktime_get_real_seconds() instead, which is simpler and avoids confusion about whether it is y2038-safe or not. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/realtek/rtlwifi/core.c | 10 ++++------ drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 3 +-- drivers/net/wireless/realtek/rtlwifi/wifi.h | 2 +- 3 files changed, 6 insertions(+), 9 deletions(-) -- 2.9.0 diff --git a/drivers/net/wireless/realtek/rtlwifi/core.c b/drivers/net/wireless/realtek/rtlwifi/core.c index 1147327e6f52..533e9cc4c84b 100644 --- a/drivers/net/wireless/realtek/rtlwifi/core.c +++ b/drivers/net/wireless/realtek/rtlwifi/core.c @@ -550,15 +550,13 @@ static int rtl_op_suspend(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); - struct timeval ts; RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, "\n"); if (WARN_ON(!wow)) return -EINVAL; /* to resolve s4 can not wake up*/ - do_gettimeofday(&ts); - rtlhal->last_suspend_sec = ts.tv_sec; + rtlhal->last_suspend_sec = ktime_get_real_seconds(); if ((ppsc->wo_wlan_mode & WAKE_ON_PATTERN_MATCH) && wow->n_patterns) _rtl_add_wowlan_patterns(hw, wow); @@ -577,7 +575,7 @@ static int rtl_op_resume(struct ieee80211_hw *hw) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); struct rtl_mac *mac = rtl_mac(rtl_priv(hw)); - struct timeval ts; + time64_t now; RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, "\n"); rtlhal->driver_is_goingto_unload = false; @@ -585,8 +583,8 @@ static int rtl_op_resume(struct ieee80211_hw *hw) rtlhal->wake_from_pnp_sleep = true; /* to resovle s4 can not wake up*/ - do_gettimeofday(&ts); - if (ts.tv_sec - rtlhal->last_suspend_sec < 5) + now = ktime_get_real_seconds(); + if (now - rtlhal->last_suspend_sec < 5) return -1; rtl_op_start(hw); diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index 20ffe856180e..ad28e188bd04 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c @@ -1373,8 +1373,7 @@ static void _rtl8821ae_get_wakeup_reason(struct ieee80211_hw *hw) ppsc->wakeup_reason = 0; - do_gettimeofday(&ts); - rtlhal->last_suspend_sec = ts.tv_sec; + rtlhal->last_suspend_sec = ktime_get_real_seconds(); switch (fw_reason) { case FW_WOW_V2_PTK_UPDATE_EVENT: diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 22afc14c3da6..6f1b0f4667d9 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -1599,7 +1599,7 @@ struct rtl_hal { bool enter_pnp_sleep; bool wake_from_pnp_sleep; bool wow_enabled; - __kernel_time_t last_suspend_sec; + time64_t last_suspend_sec; u32 wowlan_fwsize; u8 *wowlan_firmware; From patchwork Mon Nov 6 13:55:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 118053 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2793316qgn; Mon, 6 Nov 2017 05:58:01 -0800 (PST) X-Google-Smtp-Source: ABhQp+Qd261CkLZAjadiGx1PtPqSBjFM4H/ZXrnLUBb4zVCa0HsWUxz4ygzCxcE1UPoiHHVDopns X-Received: by 10.84.208.227 with SMTP id c32mr14271732plj.91.1509976681352; Mon, 06 Nov 2017 05:58:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509976681; cv=none; d=google.com; s=arc-20160816; b=c4/TNeexSjQlSLy/0Wb7X9fU+NInQzyfPqx4BWEZVwmazvXeYneRJpMb5mjMUv2lAE 4w3zhsSXgyhh9EK4ivKjSj0kgSNhvU3h0x+DSiUyfQ+cvSnrpZYNBFqD5OPpKhciVGkv jbck/z/pXzhi9Br7JhfVHFzDFJyyXeteSFBGl80C4voKkHPKNoVmTHoodGyrl4cUNfay nVXVH3OaXUdkIL2b4thKPU/5bM6HfYxjMYC4ZPLranAQ/EzAIXxQsgbu1DhzoaN+SwFd PaLuj++iJLgAYyjltc8nICChvPWK7lmNxuvr2+Lmln/P7zX5MzvCto1PYLE4N73A5J4c 5UCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ndTnV3ky/1gTa/JrY3gmXXzK74HQLqhMapWX6pbtTtY=; b=mbgKfuoyFCGYPhlrvIqmZnQKXGQ1mbglzc9h5g5XUj4+EgKMIq9r6PShlUlYqPUhdi 7UmB7fW4vnpT6gcF4go2EFkAvCishqFtP61z8v4NRCuqw6AOXfgolkRPUNc4nUspzPsq rTrsLy+PEWXkg146yiEGm9AcZ2DgzoTvBaEmzU0n3Hy0kee81qvI/B0WLtwBgqaGjZUZ g/6lkKE6eOHWevIM5ax56NuqTLys7JIRmC84YW3XtcEl3h9KpGo4Ln5Bh2Fy47rk46Tf 3pJpyClbVNnX3TO4gzr3VzgnSWYp5X6g2myz6/QSsT2+IKRNYo7gQPE7s+tqSVaYwuCf J5nQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l190si11179621pgd.26.2017.11.06.05.58.00; Mon, 06 Nov 2017 05:58:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753437AbdKFN57 (ORCPT + 26 others); Mon, 6 Nov 2017 08:57:59 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:56136 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753131AbdKFN55 (ORCPT ); Mon, 6 Nov 2017 08:57:57 -0500 Received: from wuerfel.lan ([109.193.157.232]) by mrelayeu.kundenserver.de (mreue102 [212.227.15.145]) with ESMTPA (Nemesis) id 0MVteq-1eibty3IYC-00X3vr; Mon, 06 Nov 2017 14:57:46 +0100 From: Arnd Bergmann To: Larry Finger , Chaoming Li , Kalle Valo Cc: Arnd Bergmann , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] rtlwifi: drop unused ppsc->last_wakeup_time Date: Mon, 6 Nov 2017 14:55:37 +0100 Message-Id: <20171106135619.1248453-3-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171106135619.1248453-1-arnd@arndb.de> References: <20171106135619.1248453-1-arnd@arndb.de> X-Provags-ID: V03:K0:1UHN0JMBY2UT9WEXCH7XNtsggsBNa5bgmR59B33f1cn1j3Q5SH0 qrS6U2bjRvNpoXJzicGJSpNdDxijeW4YVEhB7Q7bIItMZMqKbf5eZH4JAB8fFUjFnFQy1lG hbhJeCNrQbOM5BeQMTmph6h6bxgdAdpeXJDukQUP+5bonoqSs4qnpyBTKf5TiZjy5nW/bXz S553I5xS1RgFLz8unLmUQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:s6joNLk5kIg=:VbHjyuWv0IWYMHEAeBJ3+d 1UpU+Dk7V8qQiYaSSmU8DCxQfTRwPIaVAZK/2u6ClSmr+z0kS5r7z9X8AE6MYpKQfn5KceiAi 8AzZJaa677moQySQLBl3SWcv5BhNsQ0buH3iABjQguzrsgNBmwGLM5DemGlc0m2bD+fgkfFAK Xxd6IgdmOizDftuvLg2RfLj5GEmhzTaBGR85bUzc17ZxLCvPfvXjSWcUxE+Sr/h7VNN8/egiy xzIrHIkX79x7ZVLT7MXZm9d0mfSgGDJEhvMJ/5rqFV7niV5upY7Ovt3gbXP3rh29jnLxwUbXQ aIWOS34oI+iZf4si/ANQ6mFEVhGD6KWVMIfAxyO1JXyTWFirxuZQ0wtDDEB9Y/pAhQIckIq67 yju2nPEj4R1FTNkspP0d7UlzF1xBYICfzgTCsoM9tR/3xNBFbILtVkBpHPq/BxR9K+GQnzB4k pbMSop+tUZY3Of+gc4gV/e6lUefQvxh+YnyWOz4G5iClPG6u8YrYNnYGHxmu8NLVbzjapjRLn HIqOAJJVkqk/HDrHLKGagck9SDy5P5eUk5XMX+dLEDERCIo1AanuMEeUccal6lEk3353bTsw9 IRvQdoO3toAy+1q0Epyio2pg70r6DZZ58UxD48otHcN2R3NW3XHfvADv/pPbNKRxtepNVsj9E QcMBKeMmW6sjHR3SWskIRcvb5+Wcv33AosNYnSJFOH8M3cGtLgA9IPtj0ovTH5LWaKN5O+YXi LW9N3hGIBVBnFh75Ptabwy2DZmVBqxkIaR47Ag== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The calculation of ppsc->last_wakeup_time is not y2038-safe, but the variable is not used at all, so we can simply drop it. Signed-off-by: Arnd Bergmann --- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 5 ----- drivers/net/wireless/realtek/rtlwifi/wifi.h | 2 -- 2 files changed, 7 deletions(-) -- 2.9.0 diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c index ad28e188bd04..36f785c4ea0f 100644 --- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c @@ -1364,7 +1364,6 @@ static void _rtl8821ae_get_wakeup_reason(struct ieee80211_hw *hw) struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw)); struct rtl_ps_ctl *ppsc = rtl_psc(rtlpriv); u8 fw_reason = 0; - struct timeval ts; fw_reason = rtl_read_byte(rtlpriv, REG_MCUTST_WOWLAN); @@ -1378,15 +1377,11 @@ static void _rtl8821ae_get_wakeup_reason(struct ieee80211_hw *hw) switch (fw_reason) { case FW_WOW_V2_PTK_UPDATE_EVENT: ppsc->wakeup_reason = WOL_REASON_PTK_UPDATE; - do_gettimeofday(&ts); - ppsc->last_wakeup_time = ts.tv_sec*1000 + ts.tv_usec/1000; RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, "It's a WOL PTK Key update event!\n"); break; case FW_WOW_V2_GTK_UPDATE_EVENT: ppsc->wakeup_reason = WOL_REASON_GTK_UPDATE; - do_gettimeofday(&ts); - ppsc->last_wakeup_time = ts.tv_sec*1000 + ts.tv_usec/1000; RT_TRACE(rtlpriv, COMP_POWER, DBG_DMESG, "It's a WOL GTK Key update event!\n"); break; diff --git a/drivers/net/wireless/realtek/rtlwifi/wifi.h b/drivers/net/wireless/realtek/rtlwifi/wifi.h index 6f1b0f4667d9..d9776af41976 100644 --- a/drivers/net/wireless/realtek/rtlwifi/wifi.h +++ b/drivers/net/wireless/realtek/rtlwifi/wifi.h @@ -1953,8 +1953,6 @@ struct rtl_ps_ctl { u8 gtk_offload_enable; /* Used for WOL, indicates the reason for waking event.*/ u32 wakeup_reason; - /* Record the last waking time for comparison with setting key. */ - u64 last_wakeup_time; }; struct rtl_stats {