Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2203916rwi; Sat, 15 Oct 2022 09:31:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6XoypnBGxHFvGYpC3rgzZ8Yd16vInABKsIawHtZifSwpeUlwFKR1jTmE/1REx0sEneCC66 X-Received: by 2002:a17:90b:4b42:b0:20d:954e:28d with SMTP id mi2-20020a17090b4b4200b0020d954e028dmr20880528pjb.93.1665851465724; Sat, 15 Oct 2022 09:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665851465; cv=none; d=google.com; s=arc-20160816; b=dTJgdm1lQigY6yYCzb+YI5zrh6fjFrwJpQ5X6PLpxXOcvAa73Fv0ly94kl87+sM40E Xj9Q6U0G2lfxxEXD0yOOCaZwexYOAlqx596gWGogxbj+janh1UEvToWVA4Cvhwc70c88 wzGXaex+BwCl2VisqUNoBhrML9xHl+TNLe1dNijdvAtGtizdDEpHs3BKkUnMaLKgdVPx hMsaDlPhItW+BcR7R8lXAexWwtJ3WEmzm8ZjkkxedKmt14+PKZWUOGYI6xTXkjAzlxSY wuNmZu9MIHICDxZyUUXMbbFUXyNDEiA+gpWBfHI2T4MndP+dABezcJdovBzEZneomCPn 9qZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=T3HHUyAX1B91skwUMpCNzF5YH2X1NSjsOWajnMHTyfg=; b=iAiJxZkdx5op+OFzwBg3j4AiMUPZNoPRaZ/KjhBVDgL09CoaBrNkWD3StJ7UoNlLLz 1GAeH1dcqYNrgssCINBXDJjlCTkit4ufNww+6Z4BmvoW89UlbNA5phu39GWjGqfTmEto ZjAB+YqDN5TnopKFNZ8uz9/hSNX/vX+Cd5/bQRXxFvzljQadAC80elvMnoiFNVzIN9t6 RerQK0LNKbgRFypRGEKpUbUr/m+07ChqpCsGPWhkRri/WbpgGvC9QmcHn5+0gmb4ylSz TLscm8/2pqD4mIKhaRFyknJcRGtcb9V7Dkfr4BFza8dlFRo0cby4ol5QnnvXC7A3wjCP immw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NcMgL1fI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020a1709026b8500b00176c12fef06si6218605plk.25.2022.10.15.09.30.32; Sat, 15 Oct 2022 09:31: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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NcMgL1fI; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbiJOPmG (ORCPT + 99 others); Sat, 15 Oct 2022 11:42:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbiJOPmF (ORCPT ); Sat, 15 Oct 2022 11:42:05 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67DC14DB47 for ; Sat, 15 Oct 2022 08:42:03 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id r14so11471716lfm.2 for ; Sat, 15 Oct 2022 08:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=T3HHUyAX1B91skwUMpCNzF5YH2X1NSjsOWajnMHTyfg=; b=NcMgL1fI/W6UHod6hJJkyRTb5pbZ24URofllLCclllXe7jqHORqbqxW6iGd40O3Xg7 famY83tWIAKrqDNcN8QXJj6wkJ7/a79K0Yq1+WnKVwGSysxot408y117Ox2aj5gD4Y0/ RN9iUUOyDf010En5ysQC6HP1/j6tPdg/dv5xbWMFX58JHDO8CgB59Q8qcuF6YYnHljSq 9NHifa8v3H8tHNP1OWXlEot0HZgc7UQYZsWk7Wv66CBoNf3wfC6oQUJ5cpONxR8v58ty Aj/AnDEIxc8tEWSxu6o015SNir+gQ57OrE/7hRXAW12Ti+vTd+PIY9E826aSP73/D4We /RAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=T3HHUyAX1B91skwUMpCNzF5YH2X1NSjsOWajnMHTyfg=; b=Vu9Xod3+Kb2aQGGfPyDaTQ5R4lUy8Ere8PP6QLKc0nG9j5HwfODYjlNnXaojr0ecwJ na+qBGYK4MyMecrozuTBWrzq4yyEf98opCcaGkRLyjzwzDCMKd96zLwuQHJ+ei080K4+ uhSSKkqLF7YgeQG0pIXukNyCDBs0gaCqTvEdv16XQByQO9ZGwAqGcoE6vAjgzA4dSTWu wn1M4H5uncd0TUi2eyeT7pYOjBToplcZ4qNa7PDG6flpLQOaztAzYHNPALLRG+YPgBNu lqUCsUm7FYa5sKSjn7uv9YZGvW5NG06yGRGctpFBXtSa3Wr85kB/ICN//V14legFdu7h VdCQ== X-Gm-Message-State: ACrzQf1w1GZUZzt0xGU0j0nmGeEW9Md3oQjDAiS1orSGBFr5x+dJpJM0 yF6QNOUuXbrPT6jzX392Lqo= X-Received: by 2002:a05:6512:1196:b0:4a2:4ddb:8415 with SMTP id g22-20020a056512119600b004a24ddb8415mr1139044lfr.518.1665848521488; Sat, 15 Oct 2022 08:42:01 -0700 (PDT) Received: from [192.168.1.11] ([94.103.224.165]) by smtp.gmail.com with ESMTPSA id du13-20020a056512298d00b0048b143c09c2sm761317lfb.259.2022.10.15.08.42.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Oct 2022 08:42:00 -0700 (PDT) Message-ID: <7d72c804-265e-b515-78a7-976deaa06310@gmail.com> Date: Sat, 15 Oct 2022 18:42:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH 03/10] staging: r8188eu: fix status updates in SwLedOff To: Martin Kaiser , Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org References: <20221015151115.232095-1-martin@kaiser.cx> <20221015151115.232095-4-martin@kaiser.cx> Content-Language: en-US From: Pavel Skripkin In-Reply-To: <20221015151115.232095-4-martin@kaiser.cx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Hi Martin, Martin Kaiser says: > 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; > } > If we don't always update the state then, I think, it's better to inform the callers about it I guess, this won't happen often, but you are changing semantic of the function With regards, Pavel Skripkin