Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2121902rwi; Sat, 15 Oct 2022 08:15:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5IJTfXSGe4VDOnXAyZg1cG0l/nKO0+zKSiC6JDtCyuncoeuCpM5OHz5383IWdA6PfWnVkt X-Received: by 2002:a05:6402:3215:b0:45c:97de:b438 with SMTP id g21-20020a056402321500b0045c97deb438mr2681206eda.7.1665846946416; Sat, 15 Oct 2022 08:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665846946; cv=none; d=google.com; s=arc-20160816; b=VQiSkDfumo/CojIGkXFWAg//CQL4kSUJNDTS9u+OCXUnbJISv95+uii4z075BK2rJf HPp3Y160NToIvjnfKeItQNei/23K4k0D5KEOjQBpku1EyIcMaUxJVmndWXYCcZWkqP1U MxeDMwg+JRP2wZTnyYI+ikX3ZyzmlroDy4ZmB0MmPeAQFqRFL7Rqy6qAZdYs7fiLsZRK sDq2jG0zqepFELoVe/K2oZYk7tO60x2tH7dzZxoKbz8CEVjJaeKdzX01qw70HZQBMR+O p+XnmlPFXuBt3y4QPTSp1IjF065bhwtU9flr45CW2Cy8nxcL6Js1vSHn6Ni/nC+ZfXPb fuoQ== 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 Return-Path: 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.15.20; Sat, 15 Oct 2022 08:15:46 -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 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 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. */ -- 2.30.2