From patchwork Sun Nov 6 12:49:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 16127 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1477120wru; Sun, 6 Nov 2022 04:51:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM4eqZ3I7wTsDf81OK9bu4SIJDLsVT+S/pnHn9b29tMQAmcpFfwVGPGDM8tidK93xaGaAl44 X-Received: by 2002:a17:90a:5517:b0:213:b122:41b3 with SMTP id b23-20020a17090a551700b00213b12241b3mr43691319pji.121.1667739100835; Sun, 06 Nov 2022 04:51:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667739100; cv=none; d=google.com; s=arc-20160816; b=0sJsY2oJrQu7e55KzGxRRku4RyAYXQMCJz3txQXgx3VSx3+z+DEbN+R0Y/XdoBFrnM EOBD9G1RAJnImDAd2dXE0O1mMvi33Qg9MJoTrRvYVi3zmLoHzQdQfyzjIg33q+i082lE iQ/49VFiYAigjnDAhDZJspCq880AsE/v4sYEoVzUoLh4uiChLZA0thGFqRzh1HmbQn48 DorvSRGHMRAyP/ZjRiE1Ehjx5VFxi5xhhRl3QitqmEmLqJOGwCy3CUBjW0Bq8b77EuDv DZOxfijZ/SubPm9+DKbnBfYIk+wdXKy/0ZQ3EyiC8kT4dWbcvTt+dpSFhP3moG9JrdQK asdQ== 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=q6OUP76AAwiprYadAtwUs/r558eQStsdsYOgufct/Rg=; b=S1RBuCsBvPGLwV5RUDQ8EhxdNs2r0I2FHRhvj1yozHeONsmd5f7wuRRUlX9TLI5ykK fklc55LYdHrYPF+sNJI5q0ZcPeppeI4c9mq67qf8fpXZGxis5W+bDgOoKtJURtwhTVML Bj586GXVxKvuIPV1F2TFgS6OSiOruv8VEnbcmKYMKkN/fKEfZrpl2sO8s6gq2Tdro77n siUbHgVloQUA7GHiAL9o6jBqNHinV6Ezmd9yKsuKhn3NFAethi+83pYU/oWVpK0eWYIf 0B+GZEmFCHCMjCYtxltKSnhfOdhQpQO8SUP2JTXUuuHgLYGGnWFARPmatgaNwYRL/zlG AmzA== 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 k9-20020a170902ce0900b001868a61d507si6758265plg.180.2022.11.06.04.51.28; Sun, 06 Nov 2022 04:51:40 -0800 (PST) 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 S230073AbiKFMtl (ORCPT + 99 others); Sun, 6 Nov 2022 07:49:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbiKFMtU (ORCPT ); Sun, 6 Nov 2022 07:49:20 -0500 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 CF79364D7 for ; Sun, 6 Nov 2022 04:49:19 -0800 (PST) Received: from ipservice-092-217-068-220.092.217.pools.vodafone-ip.de ([92.217.68.220] 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 1orf5O-0008Dj-AB; Sun, 06 Nov 2022 13:49:14 +0100 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 8/9] staging: r8188eu: merge two rtw_free_network_nolock functions Date: Sun, 6 Nov 2022 13:49:00 +0100 Message-Id: <20221106124901.720785-9-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221106124901.720785-1-martin@kaiser.cx> References: <20221106124901.720785-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?1748751195706503435?= X-GMAIL-MSGID: =?utf-8?q?1748751195706503435?= Remove the _rtw_free_network_nolock function and merge it into rtw_free_network_nolock, which is its only caller. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme.c | 23 ++++++++-------------- drivers/staging/r8188eu/include/rtw_mlme.h | 2 -- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c index a47ae33454b3..b272123626ac 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme.c +++ b/drivers/staging/r8188eu/core/rtw_mlme.c @@ -76,19 +76,6 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor spin_unlock_bh(&free_queue->lock); } -void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork) -{ - struct __queue *free_queue = &pmlmepriv->free_bss_pool; - - if (!pnetwork) - return; - if (pnetwork->fixed) - return; - list_del_init(&pnetwork->list); - list_add_tail(&pnetwork->list, get_list_head(free_queue)); - pmlmepriv->num_of_scanned--; -} - /* return the wlan_network with the matching addr @@ -307,9 +294,15 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv) static void rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork) { + struct __queue *free_queue = &pmlmepriv->free_bss_pool; - _rtw_free_network_nolock(pmlmepriv, pnetwork); - + if (!pnetwork) + return; + if (pnetwork->fixed) + return; + list_del_init(&pnetwork->list); + list_add_tail(&pnetwork->list, get_list_head(free_queue)); + pmlmepriv->num_of_scanned--; } void rtw_free_network_queue(struct adapter *dev, u8 isfreeall) diff --git a/drivers/staging/r8188eu/include/rtw_mlme.h b/drivers/staging/r8188eu/include/rtw_mlme.h index 268f898b151b..3ff653ff1d81 100644 --- a/drivers/staging/r8188eu/include/rtw_mlme.h +++ b/drivers/staging/r8188eu/include/rtw_mlme.h @@ -539,8 +539,6 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv); void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall); -void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, - struct wlan_network *pnetwork); struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr);