From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from viti.kaiser.cx (viti.kaiser.cx [85.214.81.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5795EA26 for ; Sat, 9 Apr 2022 15:16:14 +0000 (UTC) Received: from ipservice-092-217-091-111.092.217.pools.vodafone-ip.de ([92.217.91.111] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1ndCom-0005k2-H9; Sat, 09 Apr 2022 17:16:04 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/8] staging: r8188eu: simplify delay conditions in rtw_pwr_wakeup Date: Sat, 9 Apr 2022 17:15:50 +0200 Message-Id: <20220409151557.207980-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220409151557.207980-1-martin@kaiser.cx> References: <20220409151557.207980-1-martin@kaiser.cx> Precedence: bulk X-Mailing-List: linux-staging@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Simplify the conditions for a loop in rtw_pwr_wakeup that waits while the system is suspended. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_pwrctrl.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_pwrctrl.c b/drivers/staging/r8188eu/core/rtw_pwrctrl.c index efdc7de49d49..7c1e79808087 100644 --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c @@ -378,12 +378,8 @@ int rtw_pwr_wakeup(struct adapter *padapter) } /* System suspend is not allowed to wakeup */ - if (pwrpriv->bInSuspend) { - while (pwrpriv->bInSuspend && - (rtw_get_passing_time_ms(start) <= 3000 || - (rtw_get_passing_time_ms(start) <= 500))) - msleep(10); - } + while (pwrpriv->bInSuspend && rtw_get_passing_time_ms(start) <= 3000) + msleep(10); /* I think this should be check in IPS, LPS, autosuspend functions... */ if (check_fwstate(pmlmepriv, _FW_LINKED)) { -- 2.30.2