From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F03F0C433F5 for ; Wed, 13 Apr 2022 19:37:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238393AbiDMTkI (ORCPT ); Wed, 13 Apr 2022 15:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236023AbiDMTkD (ORCPT ); Wed, 13 Apr 2022 15:40:03 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3E6876662 for ; Wed, 13 Apr 2022 12:37:40 -0700 (PDT) Received: from dslb-178-004-174-121.178.004.pools.vodafone-ip.de ([178.4.174.121] 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 1neio5-0005fr-01; Wed, 13 Apr 2022 21:37:37 +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 v2 1/8] staging: r8188eu: simplify delay conditions in rtw_pwr_wakeup Date: Wed, 13 Apr 2022 21:36:47 +0200 Message-Id: <20220413193654.258507-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220413193654.258507-1-martin@kaiser.cx> References: <20220409151557.207980-1-martin@kaiser.cx> <20220413193654.258507-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 8c2e98361e47..8150894fba82 100644 --- a/drivers/staging/r8188eu/core/rtw_pwrctrl.c +++ b/drivers/staging/r8188eu/core/rtw_pwrctrl.c @@ -388,12 +388,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