Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2132974rwi; Sat, 15 Oct 2022 08:25:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7rKzY5nLJNrUpqwCev1aBbEa8ekkBrDfju3DYgP3DNLJizffp6rPxx8/6NwdeZz+QayK8i X-Received: by 2002:a17:90a:2a42:b0:20a:6232:a2ab with SMTP id d2-20020a17090a2a4200b0020a6232a2abmr23734402pjg.66.1665847536705; Sat, 15 Oct 2022 08:25:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665847536; cv=none; d=google.com; s=arc-20160816; b=WHUyHKntGooZk5voxOZgbuzhkL41kDhhA8IY+rFdyNKs2svUk2GBW+O07/mxSWa7Kq cnOqpf+RvEG7qpFcBnl7o82+0G64o8s2EVn5sl4D1Ky5o4ETUaBwQzayvuj3DjUBjN0c YYStqCiJgYUix+z3hfn1s4a28CaS1sH5JydS0ABMh89SIBD/zg5f6g437vFCp7reGC04 zK2vGxJKACFE4roIrQCNIfK72TLh4a6bsE4aBAyy6BBMdU3y+M2ymtRvF8EhSit84yLe O7SAhHMtoiAaDVZP5chLLFUpsWLMlg+zaDKK9FSXjL+6P6QYHTtZ3IRVbSMRH8vfFpss PI4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=TmmuCu3IWXGSC/1IWrsM5P5RGught3IrRo75JeSN81o=; b=MqTWyvL2GMzc/1r9MmHwbXP/i5vvGRGRcmmgRhez5dXdLBBQSJdDFrBIPPvy8cWraY YircEcYQC6p99TxGgGI9QN22llZXMvcCT/JdSskPZbofZZ8kOh4FiuPpHU5O/MbFMhES chzptYDMznyqQOaf/F8qSJoXf9tCsg83loUYFYz5xrWjfFfgaYiLTK1WeQaDijEgSWWO uWlA0ZZ3L9lDXPK9TTNTe1kfIe3++eA7s1nSr5LeCouFQ65WWrWQrm7YiTexyhO64HtR OQ5+gFb4HrWeMtyjjA7rIC+twUKJ6IxL6A3bYO36NYDnVkXZqAyrZusgQmny1uBrMWy2 2cEg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a170902da8700b0016d09df65d8si7207858plx.411.2022.10.15.08.25.24; Sat, 15 Oct 2022 08:25:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiJOPMh (ORCPT + 99 others); Sat, 15 Oct 2022 11:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiJOPLr (ORCPT ); Sat, 15 Oct 2022 11:11:47 -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 A625B476F2 for ; Sat, 15 Oct 2022 08:11:43 -0700 (PDT) Received: from ipservice-092-217-066-135.092.217.pools.vodafone-ip.de ([92.217.66.135] 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 1ojip9-0006sp-Iy; Sat, 15 Oct 2022 17:11:39 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , Pavel Skripkin , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 10/10] staging: r8188eu: summarize tx/rx and scan blinking Date: Sat, 15 Oct 2022 17:11:15 +0200 Message-Id: <20221015151115.232095-11-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221015151115.232095-1-martin@kaiser.cx> References: <20221015151115.232095-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Summarize the code for tx/rx blinking and for scan blinking in blink_work. The only difference is the delay for scheduling the next worker. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index f8bd183fba1e..ce8de2eb7845 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -81,21 +81,6 @@ static void blink_work(struct work_struct *work) schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); break; case LED_BLINK_SCAN: - pLed->BlinkTimes--; - if (pLed->BlinkTimes == 0) { - if (check_fwstate(pmlmepriv, _FW_LINKED)) { - pLed->CurrLedState = LED_BLINK_NORMAL; - schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL); - } else { - pLed->CurrLedState = LED_BLINK_SLOWLY; - schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL); - } - pLed->bLedBlinkInProgress = false; - pLed->bLedScanBlinkInProgress = false; - } else { - schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL); - } - break; case LED_BLINK_TXRX: pLed->BlinkTimes--; if (pLed->BlinkTimes == 0) { @@ -109,7 +94,9 @@ static void blink_work(struct work_struct *work) pLed->bLedBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false; } else { - schedule_delayed_work(&pLed->blink_work, LED_BLINK_FASTER_INTVL); + schedule_delayed_work(&pLed->blink_work, + pLed->CurrLedState == LED_BLINK_SCAN ? + LED_BLINK_SCAN_INTVL : LED_BLINK_FASTER_INTVL); } break; case LED_BLINK_WPS: -- 2.30.2