From patchwork Sat Oct 15 15:11:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2944 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679259wrs; Sat, 15 Oct 2022 08:13:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LnNQ7MjTMhS9pAypX4ktqEoZOhVtekPpb6LjJOqQw77sUElQIpyJmI30wIn5giXdOV3W9 X-Received: by 2002:a17:907:9491:b0:78d:337e:580f with SMTP id dm17-20020a170907949100b0078d337e580fmr2369685ejc.464.1665846784410; Sat, 15 Oct 2022 08:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846784; cv=none; d=google.com; s=arc-20160816; b=JzHN/q4Pt4X3s02NpHkTkIjGNi/fRqexwlF715Iiur//peF91rcR6u65tg/8yShk/0 40LutAEtO3Py7EME26vZx9BB+QVDmt0yKtk4yen5ME4N8hgdVQBM8zt5IES9W36TIXIK c+5sV9ou+ZU1mYkoW0WMy6VnSGPDDh/Xn1vLD4+keIsxK0j3f6OUWj8SSXVLBRs8+wsY XJROGjuof+LKnPrMp0J1jlc6U98zlFf2D49iJQLY1iT1jm59YktIX69ePugiK6Has4w2 ZKsLGtJBliO7eLusLSYOsu2RQ6Avxf9RcNkKXPrIrpdUvvvoo9F61/mKiaB2aI1wB2RN 6bjQ== 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=vuJA+TZ3HNUdjNK5IhfSOrstxbZmkOZqERVEnOtXl2M=; b=DdMQ6FzCL/k5Y6eexoemhDM50Dhlo+el1JhWX8CJG96DV81N0lEe1jsCtHtP6Ligog h7F4tTHfmaM5N03qnER7rm4yLK9fB3LvvmB7p0++9587JKvwknRit+ojyaOdZHbDLxi7 UwgWW7XLilvWOdrqxGKWwBj6IjQkX7qT+1p82z19ereM/Mc1xnE0zjPAgQ3p1kqbyK+P UBbJOG6c0V7yu1u8haQhJzD8FAdN5gSDndPDSGZ1lEdiiMY3vPdV//+SYQ5hEovBqWnh EspI9JDzE3ZNwNoIdNpdrt47XfXIhO5eXV2ow52wFpCKDvDXxL6Y+99i7o4QHP5DKL9o UMsg== 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 w5-20020a170906d20500b0078d2784552fsi4623929ejz.684.2022.10.15.08.12.38; Sat, 15 Oct 2022 08:13:04 -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 S229766AbiJOPLj (ORCPT + 99 others); Sat, 15 Oct 2022 11:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229764AbiJOPLg (ORCPT ); Sat, 15 Oct 2022 11:11:36 -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 5A517422E1 for ; Sat, 15 Oct 2022 08:11:35 -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 1ojip1-0006sp-Er; Sat, 15 Oct 2022 17:11:31 +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 , stable@vger.kernel.org Subject: [PATCH 01/10] staging: r8188eu: fix led register settings Date: Sat, 15 Oct 2022 17:11:06 +0200 Message-Id: <20221015151115.232095-2-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?1746766957768398911?= X-GMAIL-MSGID: =?utf-8?q?1746766957768398911?= Using an InterTech DMG-02 dongle, the led remains on when the system goes into standby mode. After wakeup, it's no longer possible to control the led. It turned out that the register settings to enable or disable the led were not correct. They worked for some dongles like the Edimax V2 but not for others like the InterTech DMG-02. This patch fixes the register settings. Bit 3 in the led_cfg2 register controls the led status, bit 5 must always be set to be able to control the led, bit 6 has no influence on the led. Setting the mac_pinmux_cfg register is not necessary. These settings were tested with Edimax V2 and InterTech DMG-02. Cc: stable@vger.kernel.org Fixes: 8cd574e6af54 ("staging: r8188eu: introduce new hal dir for RTL8188eu driver") Suggested-by: Michael Straube Signed-off-by: Martin Kaiser Tested-by: Michael Straube # InterTech DMG-02, --- drivers/staging/r8188eu/core/rtw_led.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 2527c252c3e9..5b214488571b 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -31,40 +31,19 @@ static void ResetLedStatus(struct led_priv *pLed) static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) { - u8 LedCfg; - int res; - if (padapter->bDriverStopped) return; - res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg); - if (res) - return; - - rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /* SW control led0 on. */ + rtw_write8(padapter, REG_LEDCFG2, BIT(5)); /* SW control led0 on. */ pLed->bLedOn = true; } static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) { - u8 LedCfg; - int res; - if (padapter->bDriverStopped) goto exit; - res = rtw_read8(padapter, REG_LEDCFG2, &LedCfg);/* 0x4E */ - if (res) - goto exit; - - LedCfg &= 0x90; /* Set to software control. */ - rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3))); - res = rtw_read8(padapter, REG_MAC_PINMUX_CFG, &LedCfg); - if (res) - goto exit; - - LedCfg &= 0xFE; - rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg); + rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)); exit: pLed->bLedOn = false; } From patchwork Sat Oct 15 15:11:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2945 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679281wrs; Sat, 15 Oct 2022 08:13:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7p3RDeJD6xZYBmqHynjudj1RKKKGc1fYM+izyyf4hduSNeHQCtHE3mmaNjxDNcV9sVK5/v X-Received: by 2002:a17:907:1c14:b0:78e:16cb:31bd with SMTP id nc20-20020a1709071c1400b0078e16cb31bdmr2375742ejc.394.1665846790423; Sat, 15 Oct 2022 08:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846790; cv=none; d=google.com; s=arc-20160816; b=DdsX/srS8NhAUeWinpJMGQJn16pitggKkrTpUiXixAfnFjo1W8DUZ0NEuFm/8GsJoe gmtN0c+0JzCQDto2m3ozhAJbto7sr72l45Dz/BEuGQY3Lci5g+2d1idezAz0W6wX23mC lzroeaGmzyWrG9mBfPnfZUmWuCDDqvgJd4M0XbvLODrWiIe6hYkl2ZMkE4GWXWoH1SNV k9Rppl7bswGaOgfamFK4vhAg8zrMm1IERXbjbkF1vQk2/wdSoBOlKzPPhHAEJoA//JQi PSr3yUZpbpNTmT5dshQmvPUs5XFgY6KaKspVtnnW6AsaBZyNpNpY20Ct7QqodkUQfl8K qlBA== 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=Bh7c87ig+0IBkX+75lvtUlrgfjMKPqA3WUoo/6wY1QY=; b=zYbgeiITuVF6X6bl2pG97nXkSwZ+SXbvmc7D6QMybIDImkftPkOogiMMcHlviYsqTp DnB8Mz8li/lMjlQ/AkyzCzOj+nWlQWRgCiawv8AYgDogvSj/CLIal3bzLj6Klp+SF0je Sbfbtwvw736jbzaILdpQLJCTNnvkyFSTc35/bh1j+JiVXSyu+WWLRnwx1Qy6oh0G+6Df rz0B+459ppzvT7AXGSzj9xIJ8j+PvKwTNuSz2XBVps4cE7fvpZJB5tCRtDag7WMFC3VE HGYtfHiJ9jhTrMcMs2WWl9ugHPHTsqHkU3tmqglz6HvGRKbye1QOam8c9Ch1QmO7NG8d RKZQ== 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 hr29-20020a1709073f9d00b00781d984d289si5906447ejc.495.2022.10.15.08.12.45; Sat, 15 Oct 2022 08:13:10 -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 S229791AbiJOPLo (ORCPT + 99 others); Sat, 15 Oct 2022 11:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiJOPLi (ORCPT ); Sat, 15 Oct 2022 11:11:38 -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 B0768422DD for ; Sat, 15 Oct 2022 08:11:37 -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 1ojip2-0006sp-Fk; Sat, 15 Oct 2022 17:11:32 +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 02/10] staging: r8188eu: handle rtw_write8 errors in SwLedOn Date: Sat, 15 Oct 2022 17:11:07 +0200 Message-Id: <20221015151115.232095-3-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?1746766964350003301?= X-GMAIL-MSGID: =?utf-8?q?1746766964350003301?= Check the status returned by rtw_write8. Update bLedOn only if we could update the REG_LEDCFG2 register. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 5b214488571b..4f1cad890cae 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -34,7 +34,9 @@ static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) if (padapter->bDriverStopped) return; - rtw_write8(padapter, REG_LEDCFG2, BIT(5)); /* SW control led0 on. */ + if (rtw_write8(padapter, REG_LEDCFG2, BIT(5)) != _SUCCESS) + return; + pLed->bLedOn = true; } From patchwork Sat Oct 15 15:11:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2947 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679430wrs; Sat, 15 Oct 2022 08:13:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM791EVtv3X346TRyy1zqp8brt0blB7ngvBQRvO9mCnntlAXt0XyvkYuhlW26G3CXzaj/ija X-Received: by 2002:a05:6402:5489:b0:43b:b935:db37 with SMTP id fg9-20020a056402548900b0043bb935db37mr2738546edb.347.1665846816300; Sat, 15 Oct 2022 08:13:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846816; cv=none; d=google.com; s=arc-20160816; b=vz1YAFKz64XkwYfiGkUe8ne0tgCpUkbLL9/tGLmjCXgcMz+bmoPOszvLLQmrnGymPl ANj4Ss9v5XfeA4LWadA7j1KjAwMNu3n/77s+jx6Kp2wvOCjQnM0b1qOwYeHiVlHLV441 cK7gUF/XwVk9xLqgBXN3oJCNFkWVWZCItzS36rMt17j5Etqt6L2pFR45w8v8W97QMmel xSG7VdGGumMtbivLRA+5BPIha6rfB7h/szFbbD96CbZyhSRCAlGOkKbkemKG0T+5fNtR 9iRn/740TTmhLQuXo1iH1SQDDBA+Jd8sMf5Zf/ttkwMZMK8O0GF/iz2MKdGpOM1bB6Wy b/Zw== 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=0u9BVPii3t/g91G8+4Assb8fy9cWfsFpT2S8XNEP8p4=; b=PRGBv6fKwGNmgV7SGsBc7S+ztpOxJ8OFcKU0MU+OmzVKSy8SDw5iiwDvXrcR0RNf/5 5/kRXaODE7jfR123a/vDranmtu3/pCG+arGYP6Dec4e5dnWCQeGUthrcthiZ9AIELJjp geMZJd37lZ2H1WJ1RsGophejKjRIALtxt/mQSg54zfHGPnv4hSyJvDsvyAroxidoRc3h NiI/sNprJ5xEiWOVFAHy9w5407Qx2OLsaxCIlgIVkpjAJARZ8J/5BekiHYQ3Ozu08Ms3 Ei+biB9RGNR/nlMjz87t0WJEAi9bQhkPYtKDIvHcBHuUXtD4pPWjxMTAPSNFEBD3x+Zv ydng== 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 hr40-20020a1709073fa800b00780cb1272eesi5753444ejc.466.2022.10.15.08.13.10; Sat, 15 Oct 2022 08:13: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 S229775AbiJOPLw (ORCPT + 99 others); Sat, 15 Oct 2022 11:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiJOPLm (ORCPT ); Sat, 15 Oct 2022 11:11:42 -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 7DA6F44CFE for ; Sat, 15 Oct 2022 08:11:38 -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 1ojip3-0006sp-Bf; Sat, 15 Oct 2022 17:11:33 +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 03/10] staging: r8188eu: fix status updates in SwLedOff Date: Sat, 15 Oct 2022 17:11:08 +0200 Message-Id: <20221015151115.232095-4-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?1746766991458483662?= X-GMAIL-MSGID: =?utf-8?q?1746766991458483662?= Update bLedOn only if we could update the REG_LEDCFG2 register. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 4f1cad890cae..38433296d327 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -43,10 +43,11 @@ static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) { if (padapter->bDriverStopped) - goto exit; + return; + + if (rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)) != _SUCCESS) + return; - rtw_write8(padapter, REG_LEDCFG2, BIT(5) | BIT(3)); -exit: pLed->bLedOn = false; } From patchwork Sat Oct 15 15:11:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2946 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679375wrs; Sat, 15 Oct 2022 08:13:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wwkCN2V7RWSGkq5kOYl10kK/x9jZS1kfui6cUR2ygNGdJeXqM6TC2NKDL4YckcCSC8lPq X-Received: by 2002:a05:6402:26c2:b0:45c:1fef:ee1d with SMTP id x2-20020a05640226c200b0045c1fefee1dmr2604701edd.13.1665846804665; Sat, 15 Oct 2022 08:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846804; cv=none; d=google.com; s=arc-20160816; b=xYtWTjWH08ek5EP6o87To8RcaAJ6Atw+dpHBTuxAwLc/80Kue9+bdIAX6GvB0Z3H/w oC7ac0W+vb++82NnZBiflPozXxCzSFTGyilgzx9IiOEG7pWT8rXwkIPEKXCDtpGH0V/z 84Dv2MOruao2deyKf9ZnU5OFRKvTZoDtTdUvSVEByG4pQpeckNIgTVfyYHE6VaywNlG0 ltwtCj0XTUG0eBrALGRQDuvAtWlfEOla0Quq4axH4AN/llmcOzIFjMvb3bipIJ0BknHX uT7/ZvkJ0tpz9oAz+JN6M3j83AvpVuXJrymw7hm94+TaE4fiy8+P/GZ0KjSgU3VLpVIJ iCKw== 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=P8N5p5gAAHJz6KlwrSDfKOHeE9INoGoliCAEnlPU1EE=; b=blN531Z69Fm1PueIoA3WtdcNt1BhW9SHB7So0rODpRMY5OsKnHQmBrttc31b7wZQQF TPk8pZebYf0PFrANFR6oPJUIZf6otZgrmK/D0Czk6W/nYz218+QTkPAC9zXsMcIQqSEU cDSsnTkZ0Hu8rBIjAPHROHgb8XihHtlS1KV4zkCRCRvwXKRFXZUpakCjIzZ1Q/Pbc2fJ TGOtGzfUUbL654cYPg8oSMdfL9fjlPucAOnIYjYFdcKzpGIJk5U1Hmr9EhTyaT3ODzg3 yM6WPwA/e8vuTzBRiAhkd8jiBy6pZy15R81fE8XUElVEG/nDFUm3qOhqwneMJO28W1Zo mmNQ== 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 r10-20020a1709060d4a00b007878144285csi4387534ejh.314.2022.10.15.08.12.59; Sat, 15 Oct 2022 08:13:24 -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 S229804AbiJOPLt (ORCPT + 99 others); Sat, 15 Oct 2022 11:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbiJOPLk (ORCPT ); Sat, 15 Oct 2022 11:11:40 -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 7DC2A45997 for ; Sat, 15 Oct 2022 08:11:38 -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 1ojip4-0006sp-CF; Sat, 15 Oct 2022 17:11:34 +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 04/10] staging: r8188eu: SwLedOn needs no padapter parameter Date: Sat, 15 Oct 2022 17:11:09 +0200 Message-Id: <20221015151115.232095-5-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?1746766978972011579?= X-GMAIL-MSGID: =?utf-8?q?1746766978972011579?= Remove the padapter parameter from the SwLedOn function. padapter can be derived from the pLed parameter. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 38433296d327..aa8f41edfade 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -29,8 +29,10 @@ static void ResetLedStatus(struct led_priv *pLed) pLed->bLedScanBlinkInProgress = false; } -static void SwLedOn(struct adapter *padapter, struct led_priv *pLed) +static void SwLedOn(struct led_priv *pLed) { + struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); + if (padapter->bDriverStopped) return; @@ -67,7 +69,7 @@ static void blink_work(struct work_struct *work) if (pLed->bLedOn) SwLedOff(padapter, pLed); else - SwLedOn(padapter, pLed); + SwLedOn(pLed); switch (pLed->CurrLedState) { case LED_BLINK_SLOWLY: From patchwork Sat Oct 15 15:11:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2948 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679638wrs; Sat, 15 Oct 2022 08:14:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ziVMb+AhRGD8cs98Ac9i3dgziGyjBAnj1rqfwY073ik5ypTvqvqqmIPbi7V7ETylh1nGw X-Received: by 2002:a05:6402:410:b0:451:ea13:4ed7 with SMTP id q16-20020a056402041000b00451ea134ed7mr2776938edv.262.1665846850732; Sat, 15 Oct 2022 08:14:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846850; cv=none; d=google.com; s=arc-20160816; b=j5JauOfk/ku3Jg+KPExdiNs5aNMoCqKr65XGLdj4VhUyIks97ulx1xSnpU9Ipe3Y4U EdsMbEnNtZW1v4RzUjPJEU3U0Qcvavd1FiZfsqA0nxWCnlXS0Bujle8bdRZjG9X+sHw3 H/QaOOC3YIIp+bFKI1veYT6o/LZ8NsSvhk+FttaopTOF74BZKJSBqhcfwgSftkgpjxT0 T3WLR37C5GHa97qogDEJuqS6qOc/GDQN22LkbN2dOOdzZdiCKjcF3O/XXCSnZFPkOkI3 rq1/nr2d1FmfEmOOrycGC8MkiTkfsNc+FL9dCoOS2zM8GXirIwPeUvndbH7/uDw6rwEm 4Dxw== 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=fAWs7X3fA932yxN4uqwgOFM/fbZUojY1lEBWaA8/F+U=; b=D4reDQ27p9BnFH7j46akp/ZVtj9i59osztj1jy0lB+J1KAMEjfdYI2k1eM9yCOtWqt kWQyJE4bDlGMknhMnWDmKnbtVO/4ZHL1H41RfDDn6LesL9JTkYCk7FGpcoUJ6AcoOdkb O5YTPLbYYqBmm8EgeyXfSAy5Mx1CMTGStgtKFfJpMcUFOLKWO6Z0/jY698/RMIXdCWgt /OOEqOaXbEwndrIcXH/G0O3jrhwAO96eBLQ6rDGtX7seg3ICie8DWOX9WHvHMHeTciJ/ 16RhoZXwKozBadEqkfDiYkkOpEW03M0AZQyHqkqEKUuIAJsWkHnWK0LIcjPVvzhl2iD/ PREw== 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 t11-20020a056402524b00b0045c1782d77fsi5359889edd.40.2022.10.15.08.13.45; Sat, 15 Oct 2022 08:14:10 -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 S229774AbiJOPMB (ORCPT + 99 others); Sat, 15 Oct 2022 11:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbiJOPLo (ORCPT ); Sat, 15 Oct 2022 11:11:44 -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 85BB446847 for ; Sat, 15 Oct 2022 08:11:40 -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 1ojip5-0006sp-9a; Sat, 15 Oct 2022 17:11:35 +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 05/10] staging: r8188eu: SwLedOff needs no padapter parameter Date: Sat, 15 Oct 2022 17:11:10 +0200 Message-Id: <20221015151115.232095-6-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?1746767027253575009?= X-GMAIL-MSGID: =?utf-8?q?1746767027253575009?= Remove the padapter parameter from the SwLedOff function. padapter can be derived from the pLed parameter. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index aa8f41edfade..56f043d8ff38 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -42,8 +42,10 @@ static void SwLedOn(struct led_priv *pLed) pLed->bLedOn = true; } -static void SwLedOff(struct adapter *padapter, struct led_priv *pLed) +static void SwLedOff(struct led_priv *pLed) { + struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); + if (padapter->bDriverStopped) return; @@ -61,13 +63,13 @@ static void blink_work(struct work_struct *work) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) { - SwLedOff(padapter, pLed); + SwLedOff(pLed); ResetLedStatus(pLed); return; } if (pLed->bLedOn) - SwLedOff(padapter, pLed); + SwLedOff(pLed); else SwLedOn(pLed); @@ -141,7 +143,7 @@ void rtl8188eu_DeInitSwLeds(struct adapter *padapter) cancel_delayed_work_sync(&ledpriv->blink_work); ResetLedStatus(ledpriv); - SwLedOff(padapter, ledpriv); + SwLedOff(ledpriv); } void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) @@ -258,7 +260,7 @@ void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction) pLed->bLedWPSBlinkInProgress = false; pLed->bLedScanBlinkInProgress = false; cancel_delayed_work(&pLed->blink_work); - SwLedOff(padapter, pLed); + SwLedOff(pLed); break; default: break; From patchwork Sat Oct 15 15:11:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2950 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679674wrs; Sat, 15 Oct 2022 08:14:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fqiIJT/bUy6l4Issa2T8ZusbN7xBOb912uhMx/ZEtf3IPVTJAQDQpl8PnJgBPgTrxC5n8 X-Received: by 2002:a17:907:7805:b0:780:24fd:c4e8 with SMTP id la5-20020a170907780500b0078024fdc4e8mr2375603ejc.78.1665846857072; Sat, 15 Oct 2022 08:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846857; cv=none; d=google.com; s=arc-20160816; b=n6SfJbhRV3cZ5VJiWb949xwLoSbkkKhz2pNTuFBUL+3Qy5sA+Eu+5vz3bcH/GafMjK Zz4VRkiXi0FI/8tNgSsKKFSuLPhHxeb/To9bmA8ox43Q8kKATZDXhtq6GuJRXQeXF+n0 rInSUTiuadmw9T3GpwmmMs0L3OEFfB3bIIA0HVrywU7xhoZ7cbRUHv/MtGu4KlS6X8qE oWaTuovQmoo+fiV4vwf/4Fw3IS13HYJGunSeB/HtA1fqmkHkj/nmF5s+M4vemU6ZrMpO 9lQnIjGJ8iQ8ucX4fNR3VLsd54DoGtLhNBbAnOCyrVjuoXUl/LpqsgKD5oSxElFpS8Gh 4Klw== 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=IR3F+nnS7WYtZz0vA/6mBUHdcrKybEi1qNEmDB6euFs=; b=LPMgPoSnhDGT50vBzXVoDHQwXOhS+X8OwAJ97jWBrFcFtQb02+yVkWXEV2XwHZTZXS 6X5JflkgJY5YX2TfIvrGdCMlM+PKEMcSjqsZRa+gAycmg/8mDo5q9ZCy/MByHF0n2MSP U40shpBs3TPzdxbU8vAdqPA3KWPmSoZe0Koug94zbQ65KfLmg7MGs6FSMDcCfreSl9+G EZJ50nsDMr270VGyELINGUXysnQxnCADy1xaVTsu2VSc7HQAd4lX98diX4i58jhb3lb5 6TjEsK5KKGRB29kVI8P06HnmOLOFXeHgQlac+x/ZAoG5FU+3uZTqo/xNa4PsgHD3sKAQ 6grA== 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 h25-20020a056402095900b0045901fa87a6si4286201edz.449.2022.10.15.08.13.51; Sat, 15 Oct 2022 08:14:17 -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 S229886AbiJOPMH (ORCPT + 99 others); Sat, 15 Oct 2022 11:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229788AbiJOPLo (ORCPT ); Sat, 15 Oct 2022 11:11:44 -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 795E846DAF for ; Sat, 15 Oct 2022 08:11:41 -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 1ojip6-0006sp-4K; Sat, 15 Oct 2022 17:11:36 +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 06/10] staging: r8188eu: remove two unused defines Date: Sat, 15 Oct 2022 17:11:11 +0200 Message-Id: <20221015151115.232095-7-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?1746767033770749316?= X-GMAIL-MSGID: =?utf-8?q?1746767033770749316?= The C2H_MEM_SZ and FREE_CMDOBJ_SZ defines are not used by the r8188eu driver. Remove them. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/rtw_cmd.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h index 9a76aa85de94..20a65beed166 100644 --- a/drivers/staging/r8188eu/include/rtw_cmd.h +++ b/drivers/staging/r8188eu/include/rtw_cmd.h @@ -8,13 +8,9 @@ #include "rtw_rf.h" #include "rtw_led.h" -#define C2H_MEM_SZ (16*1024) - #include "osdep_service.h" #include "ieee80211.h" /* */ -#define FREE_CMDOBJ_SZ 128 - #define MAX_CMDSZ 1024 #define MAX_RSPSZ 512 #define MAX_EVTSZ 1024 From patchwork Sat Oct 15 15:11:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2949 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679671wrs; Sat, 15 Oct 2022 08:14:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/hNIz9jeyeFPPAQhaKRa0J/i5CmeqpJP/UK/n16v3O0NQYkoo1OpHKJXGchq3cUk8NvoV X-Received: by 2002:a05:6402:34d5:b0:45d:259:6237 with SMTP id w21-20020a05640234d500b0045d02596237mr2655281edc.164.1665846856540; Sat, 15 Oct 2022 08:14:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846856; cv=none; d=google.com; s=arc-20160816; b=zUZzEzHeDvs1vxHITfCQ30KxoJzgqIceQIkFj9+dEa2gEr3cTJP5o10yI7JS5nSnX5 rFbtw9hGEMzvNQYPhCRetv76IDGyi+UmuuNyY6Y4LBbhVenMyf2c1hUzKz1N5Al3uquj WyzN4mwcV109ihgafHTUWZ1UO+751TbcMmVuUeuKuZAESQuSAWZer0godv/eRTOUchvR vD1kFuGDGkDJz3M3qD1zoztMng8RnSWr+7Vk8Z4Usd/t28kc4xRJmi4wnUhoSq4BXK6I NDC+CFf+0bypSjmK5Qpt9n6qK3U8/pYKQaf1bu9sc0iY/zB2EuSNhkgLMS5Kylnuh0mS skLg== 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=8rCeIVel5RLr7Xb3+AGczJdY6ehqE4+f2eIiuP14fqE=; b=xLlXi3jwpu/hbjks4KAJIsE7H27mVHB47ZfNrLWEpOeTagzH8KATqMLY89fUkwtv/+ WyLkn5r6Qfy8nWET27syjG1Dg4oZDhnx/uOZ2jcq5/lpU218WQkhm2zUbx4Oei6ClCM9 a+wjUnKD5uypQAghWEmR/cu6wP1oilJjk8fPhTeW6SmcYNsd5aNq0D56mWJr+Sv8Ghbk j1wxg//oBzp/IfU797aWc/2K3ggPlBUHTcZaaNWTIVHvLxGsjpUlpm7EhTlH6lgfiLL1 WlwiutiMlLJvuOEoCWgUmdUV8HmWQVzfW32i4FzrAqp5DE0p98d/BgJeE1v5fpJXSGtX qdlA== 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 w3-20020a05640234c300b004595a90c510si6460320edc.3.2022.10.15.08.13.50; Sat, 15 Oct 2022 08:14:16 -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 S229782AbiJOPL5 (ORCPT + 99 others); Sat, 15 Oct 2022 11:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbiJOPLo (ORCPT ); Sat, 15 Oct 2022 11:11:44 -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 A7F344684D for ; Sat, 15 Oct 2022 08:11:41 -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 1ojip7-0006sp-4g; Sat, 15 Oct 2022 17:11:37 +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 07/10] staging: r8188eu: don't include rtw_led.h from rtw_cmd.h Date: Sat, 15 Oct 2022 17:11:12 +0200 Message-Id: <20221015151115.232095-8-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?1746767033321375693?= X-GMAIL-MSGID: =?utf-8?q?1746767033321375693?= The rtw_cmd.h does not need any definitions from the led layer, there's no reason to include rtw_led.h. When I tried to remove this component struct led_priv { struct adapter *padapter; ... I saw compiler errors because of this chain of include files: drv_types.h -> rtw_cmd.h -> rtw_led.h rtw_led.h uses struct adapter before it sees the definiton near the end of drv_types.h. (It seems that a simple struct adapter * prevents this problem.) The best option for fixing this issue is to not include rtw_led.h in rtw_cmd.h. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/include/rtw_cmd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/r8188eu/include/rtw_cmd.h b/drivers/staging/r8188eu/include/rtw_cmd.h index 20a65beed166..2f4595f13e86 100644 --- a/drivers/staging/r8188eu/include/rtw_cmd.h +++ b/drivers/staging/r8188eu/include/rtw_cmd.h @@ -6,7 +6,6 @@ #include "wlan_bssdef.h" #include "rtw_rf.h" -#include "rtw_led.h" #include "osdep_service.h" #include "ieee80211.h" /* */ From patchwork Sat Oct 15 15:11:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679866wrs; Sat, 15 Oct 2022 08:14:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41qgGpbC2i6nnCXW8P5ai9/ccT8dHWF0TDj3EJi9RgX+Fxd7UJ4kC4AWD7W6ytM5Rrp4GL X-Received: by 2002:a17:907:a047:b0:78d:b8ac:765d with SMTP id gz7-20020a170907a04700b0078db8ac765dmr2315981ejc.631.1665846895655; Sat, 15 Oct 2022 08:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846895; cv=none; d=google.com; s=arc-20160816; b=tyOsKhyKMLCnSXQdD/Wlrxg2fxi+K4SDOjfEIiq4d1vK7fBCVPpwWm2UcoK9l57oIn 11b1J1k5UuHChmdXGomrezhcvU38IdNtCdUjNDxibY0vIpZjbZuWVVdodzalsdEuUE6G F0yHG9yIwVxYynaEOOjqTlPLnKdjufPTk5GCXkDd6qtHWPoGRnis//JY46pdziWhSl3F BXIEKgdzBV5imA+sFbQ/7Rl243Xr2yICEdbZ48tSS2EU7sZ+99OkShbReKXCYRzrwQ4C rmA5WenhtiZkFg4wlpa/LODjLFA4MByDipRlFeOX6Jmysv1eqCTsmmCEK1Bta/CwvNKJ 8Imw== 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=VGfRWdLMNYqhs4s/fi2y9QpUqJUx/gamnlfjp8UDigI=; b=GkNdTm9/Pf29y9STltx8cLYLid3OOd1TG0Y/pOTemBvP0O9qSYvRA9eLGCfQfEn515 FbIHtI4ffujw32p+h8erxS5Y6xaihRNlUzc8xSJU2QumAaYZlBhcdoAn6LdaH73eljlU R3KKowuQW4LUGYXdX0uRzsmjjBTvEFupb/hUzSOKHi9Oy2OAps0GlDK0a0ENdxtnU3fo hPVXsEJWRQ6s6aPXIpzK1XeBqVD+2CKIhbDKXyG/6AS0Jid3MKlKh9Js/nthvWd5+lIs bFNaICn72OzjOcYeGGltj7jXwksLyc0aN19MohjmvSF4V/eRrSpCeDyy2lPcqqgQfTU1 Df0w== 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 gs9-20020a170906f18900b0078dd7383ed8si4220340ejb.414.2022.10.15.08.14.29; Sat, 15 Oct 2022 08:14:55 -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 S229845AbiJOPMP (ORCPT + 99 others); Sat, 15 Oct 2022 11:12:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229790AbiJOPLo (ORCPT ); Sat, 15 Oct 2022 11:11:44 -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 796C9474E1 for ; Sat, 15 Oct 2022 08:11:42 -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 1ojip7-0006sp-So; Sat, 15 Oct 2022 17:11:37 +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 08/10] staging: r8188eu: remove padapter from struct led_priv Date: Sat, 15 Oct 2022 17:11:13 +0200 Message-Id: <20221015151115.232095-9-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?1746767074852356682?= X-GMAIL-MSGID: =?utf-8?q?1746767074852356682?= The only struct led_priv that's used in the r8188eu driver in embedded in the driver's global struct adapter. We can use container_of to access the "outer" structure, there's no need to store a pointer to it. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 3 +-- drivers/staging/r8188eu/include/rtw_led.h | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 56f043d8ff38..2dbd7b5ffdd0 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -59,7 +59,7 @@ static void blink_work(struct work_struct *work) { struct delayed_work *dwork = to_delayed_work(work); struct led_priv *pLed = container_of(dwork, struct led_priv, blink_work); - struct adapter *padapter = pLed->padapter; + struct adapter *padapter = container_of(pLed, struct adapter, ledpriv); struct mlme_priv *pmlmepriv = &padapter->mlmepriv; if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) { @@ -132,7 +132,6 @@ void rtl8188eu_InitSwLeds(struct adapter *padapter) { struct led_priv *pledpriv = &padapter->ledpriv; - pledpriv->padapter = padapter; ResetLedStatus(pledpriv); INIT_DELAYED_WORK(&pledpriv->blink_work, blink_work); } diff --git a/drivers/staging/r8188eu/include/rtw_led.h b/drivers/staging/r8188eu/include/rtw_led.h index f57dcf6c8b24..ea5f5edd9013 100644 --- a/drivers/staging/r8188eu/include/rtw_led.h +++ b/drivers/staging/r8188eu/include/rtw_led.h @@ -33,8 +33,6 @@ enum LED_STATE_871x { }; struct led_priv { - struct adapter *padapter; - bool bRegUseLed; enum LED_STATE_871x CurrLedState; /* Current LED state. */ From patchwork Sat Oct 15 15:11:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 2952 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp679920wrs; Sat, 15 Oct 2022 08:15:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6W/erwHXuCYtCXLDpojcLK56cJwogzto7wvNwSAtKoDerKY761TmBLlmvJ8BeQRav1dzFG X-Received: by 2002:a17:907:720e:b0:78e:2b59:fdf1 with SMTP id dr14-20020a170907720e00b0078e2b59fdf1mr2399191ejc.659.1665846905212; Sat, 15 Oct 2022 08:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846905; cv=none; d=google.com; s=arc-20160816; b=E3KPCg0dmgQV7mI/2uIpdCZlo1mJ1kfYvmM7ZHzro8k3yiPmu7i0zGlR3MMskz7hRO cl2RqcXkg+eCyxVxGTdrvhDvppT2QUGxkPMRDA7J5s4quP35Pe6rLL11huw8NkLQQHbl RgjSfTQJqM0MPxPOceH4Gbz27xHrTN6dpbK7i15cgOLWtnQGyCFm8jQMiPv6sX/akV4d 4m5fYOIRJMZtsVi9vBkUDqLxOED+2ARu4/3AL/UAAvDFu4xjdCgV73dRAoML2JqAFJ+X At3suLcM9dUl+b/VoPCEq205COWQzOKMELMVrk28S/c70q6uTTWgvGuoq+txaACSd2kY ZIIA== 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=JlSf0l9NyfcSLSG0+gfuA289BMwlKNxFIacZk+dZJAs=; b=AwStyk8xezBWh1ysBTdzDHxvBwo3QTp3aLeF4z0cHrhi1JhnME9RXj2UsuFRUVeHwu VpO04E3Bl7A6IV5545DnGEHrE9FhXkv1RYHh3cNcbqNrJCmejoxXYSzL9VxzZb0JFYGT Ds+7CuCnwbiUJ+L8XqgTGOSOpdd6G8sLMy464/axY61ZkVIwdol/4DsLG6alqjP5TyBM AhYouIam/NyIFH1AS45hKGPCo8ChRG67Qjt73uO7DvKf4O7E0YnfpsAywhtAUMrFMnlX I0wdW7H7MrnYjUaEWAlSItZus+nOeoADUeABxgnOXhTqgMAjlkEM6s7tT6sNcv9yZyft 7c6A== 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 ho19-20020a1709070e9300b0078dcd448f97si5608085ejc.801.2022.10.15.08.14.39; Sat, 15 Oct 2022 08:15:05 -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 S229699AbiJOPMW (ORCPT + 99 others); Sat, 15 Oct 2022 11:12:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiJOPLq (ORCPT ); Sat, 15 Oct 2022 11:11:46 -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 7956443AD3 for ; Sat, 15 Oct 2022 08:11:41 -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 1ojip8-0006sp-Mt; Sat, 15 Oct 2022 17:11:38 +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 09/10] staging: r8188eu: set two more state variables Date: Sat, 15 Oct 2022 17:11:14 +0200 Message-Id: <20221015151115.232095-10-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?1746767084316018809?= X-GMAIL-MSGID: =?utf-8?q?1746767084316018809?= Set two more state variables in the blink worker when scan blinking and tx/rx blinking are finished. bLedBlinkInProgress is true during tx/rx blinking, bLedScanBlinkInProgress is true during scan blinking. If we doing neither of the two, we may safely set both variables to false. This change makes the scan and tx/rx cases almost identical, we are now ready to summarize the two cases. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_led.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/r8188eu/core/rtw_led.c b/drivers/staging/r8188eu/core/rtw_led.c index 2dbd7b5ffdd0..f8bd183fba1e 100644 --- a/drivers/staging/r8188eu/core/rtw_led.c +++ b/drivers/staging/r8188eu/core/rtw_led.c @@ -90,6 +90,7 @@ static void blink_work(struct work_struct *work) 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); @@ -106,6 +107,7 @@ static void blink_work(struct work_struct *work) 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_FASTER_INTVL); } 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: