From patchwork Sat Oct 15 15:11:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2953 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp680258wrs; Sat, 15 Oct 2022 08:16:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49qFMEBTsgF3IEk27MAfkWrDsVyss6RNN8d+OpEQ4Y/F0rXHizpj0lP6EcDdEfwtPXZcSg X-Received: by 2002:a05:6402:2791:b0:45d:3a94:3494 with SMTP id b17-20020a056402279100b0045d3a943494mr2629513ede.91.1665846975563; Sat, 15 Oct 2022 08:16:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846975; cv=none; d=google.com; s=arc-20160816; b=zAmcG3RejwQhorLnfUrDGAhKPMAC27901PJZKrMA1j8TlvObzzqzVh4MypyZ6dXvG7 AaM7TYg/h5eVTbmDZ8JrqRRZV2drV60deVVra7qCGjum5WpKNsUNKJ7AVgaG5j0R93u0 LDy56pMTF5bsX5iywEGW9JFsBUcCtiqCM8EffrrhVjadgfhIB1YFLqDqsqnZkhIqimBk DSJ92oidQapuQXt6ij/YKIvf6oPquRWmSOStA35sXtYyUQPdSJAlxxMsB4AcTmIxE2uN mNmvvEAHT17AG0SdDseNP/tNvmHoe9ZtfIQoug6HJY3Sw870py3v3FAqdYsZFMQScZwP qVlw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cs9-20020a170906dc8900b0078d4b88f122si5660876ejc.950.2022.10.15.08.15.41; Sat, 15 Oct 2022 08:16:15 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746767158531473003?= X-GMAIL-MSGID: =?utf-8?q?1746767158531473003?= 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: