Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp33629pxb; Tue, 12 Apr 2022 16:02:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyJ3CatE3Nu2Rne3w4we1XU6YTKoc9tTQglAGZaNFiLo/jqFCvQ0pbBa54UGWxDG2M/K98 X-Received: by 2002:a63:d94c:0:b0:399:5cc:ef25 with SMTP id e12-20020a63d94c000000b0039905ccef25mr33112228pgj.430.1649804558932; Tue, 12 Apr 2022 16:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649804558; cv=none; d=google.com; s=arc-20160816; b=NaLvZ2HlnmwggsXmFvax3PEthZrz3Z+aFkJjVVm8ULRkYsAHXNn99YtrkSh5zjB/nU M4NZVq2egfS1yQWNDsDeDPsLJsXy9yA/5TCjQaKPhlUB83rPoQef7yCl/fcZmpQEzk4e VtQmYpj21NIFOzMseTTSFGHhfZzp+u69m0yrKGBBnpnXoaCn+Jdkgd8+wS2echIOyaGc 6jsZp8GbzphNxMqFXmmTfUbyUEd7ps0zBVcpyAeyubwX1zAKvdzSBGe/0R9Y0V3LVRVf 6TfylNuosmJZgfUziLdWWe/CuKQqj9+ymHsLbrnlWI+m7OBf+E2aheMMtYaprhxx9Luv FUaA== 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 :dkim-signature; bh=pihteJgws3CPWC4SIMyqFCTdNFf4a7DVbmyRBkvm3cc=; b=iFBazsWCBuRG90jdp+c7Y397BbwBpFqDftWxXm24+8ADwKD8139cgnhZFwW4kit1nz 8eea3m1yAODUlhVXUiQlR4wZnEDauYQx5XfK+FdF+SzItnl57cOsACW71JDB2v43XIgj uc3pdw08gzkANLN7PROM5o0MPAoaBGvvIsQRa9pGo0cu7SsgLRwEtigsXN+80Y1YVe3P xvNdytscowqhREbLIL0FO4D0vnpBUptR8eXIW6DRtKxrlxh+cqs4iwXOMphWuCNBfVSI yixRWmWItFqtD1hEfcoCjfrfy4FdPmVRAEAZ5l6Y/p3ez//5nhT4mCSIaFHt4rBBa9kt yG0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ozYrBwVo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id e20-20020a170902f1d400b00153b2d16577si11052098plc.383.2022.04.12.16.02.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 16:02:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ozYrBwVo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 70EF01E5A4C; Tue, 12 Apr 2022 14:44:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345393AbiDKKZ5 (ORCPT + 99 others); Mon, 11 Apr 2022 06:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345494AbiDKKZY (ORCPT ); Mon, 11 Apr 2022 06:25:24 -0400 Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F17B344A31 for ; Mon, 11 Apr 2022 03:22:09 -0700 (PDT) Received: by mail-pg1-x529.google.com with SMTP id 32so11663341pgl.4 for ; Mon, 11 Apr 2022 03:22:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pihteJgws3CPWC4SIMyqFCTdNFf4a7DVbmyRBkvm3cc=; b=ozYrBwVoW8GtsA2LMBdHt6bDeJZtkGzYW2+K2uSshw5P4MKZPC6ecevfqXHrxlNoKX TempNdL6Nw8L916q5BfA915Cha2mG1sTewnDh/g+NpQTeohWwR3/uvpoJNSDdnRY8ob5 RC5xWCYcKmls1v5W34MCI1hksCjg9tAKgI8xz6Rcu92eXDERMbIqHbx+p5Vk9K63ZQwu 5BvNrUsLDsWNg3nTIZpno1vecNM2rFLVclLCnUxPccXBkE7qs/5ta/37e1agqvoZJH4Z yj2PL0FZ1RooB4GiTE1scRriMt54bZp1mVbRlFe4aMyhmay5cv1SOxqfmzzm16w68Pfn r92g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pihteJgws3CPWC4SIMyqFCTdNFf4a7DVbmyRBkvm3cc=; b=dY85CtUb/w4mnvNu3MGu2iJS96Zp6N2vP+aRG1Tb8XTvkTVctFPd6QgWtVSA80cVLE DqeFZGaV5d6d85cAz3JDakiyAi2KURGcYwA9hrN51GyWQSEJ72LzxvhxacCeBqpV8H4H G8ESxUHKeL0N9BNYbg6c8gImHNAM58otrTBYMkOujb86IU2RFc/et4TmXAWIaRIy+eHS 0B9ASCx5pbHB4BZQaqnOcyyiRQXuwm2lJDwhDdG2q6bGgGQxIvzVIzPBlWcuxf72caQD PYtGxyw+BgGF3Gev3UYKyK+EzPg7l0K7n7FX7EQg7bVPWRAhhCCKhQ+sEWQ239Nsj4WU v0uA== X-Gm-Message-State: AOAM531qTrbF6cSAS3M6kzRBOcumRZ8EezMC3exObgFjmJ2ClX01Zz0l u9Y+CGn9th174MZMPnLkMo1A5oHl3LRCZBT3 X-Received: by 2002:a63:35c1:0:b0:386:3620:3c80 with SMTP id c184-20020a6335c1000000b0038636203c80mr25577283pga.327.1649672529329; Mon, 11 Apr 2022 03:22:09 -0700 (PDT) Received: from makvihas.localhost.com ([2405:201:202b:15:4376:c658:ae1e:1781]) by smtp.gmail.com with ESMTPSA id z14-20020a17090a170e00b001cb7e69ee5csm4886318pjd.54.2022.04.11.03.22.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Apr 2022 03:22:09 -0700 (PDT) From: Vihas Makwana To: Larry Finger , Phillip Potter , Greg Kroah-Hartman , Michael Straube Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Dan Carpenter , Pavel Skripkin , Vihas Makwana Subject: [PATCH v2 4/7] staging: r8188eu: drop unnecessary wrapper _rtw_init_mlme_priv Date: Mon, 11 Apr 2022 15:51:33 +0530 Message-Id: <20220411102136.14937-5-makvihas@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220411102136.14937-1-makvihas@gmail.com> References: <20220411102136.14937-1-makvihas@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NO_RDNS_DOTCOM_HELO, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Drop unnecessary wrapper _rtw_init_mlme_priv and move its logic to _rtw_init_mlme_priv. Signed-off-by: Vihas Makwana --- drivers/staging/r8188eu/core/rtw_mlme.c | 103 +++++++++++------------- 1 file changed, 47 insertions(+), 56 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme.c b/drivers/staging/r8188eu/core/rtw_mlme.c index c90f36dee..6b8c80fe9 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme.c +++ b/drivers/staging/r8188eu/core/rtw_mlme.c @@ -30,60 +30,6 @@ u8 rtw_to_roaming(struct adapter *adapter) return adapter->mlmepriv.to_roaming; } -static int _rtw_init_mlme_priv(struct adapter *padapter) -{ - int i; - u8 *pbuf; - struct wlan_network *pnetwork; - struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - int res = _SUCCESS; - - /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ - - pmlmepriv->nic_hdl = (u8 *)padapter; - - pmlmepriv->pscanned = NULL; - pmlmepriv->fw_state = 0; - pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown; - pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */ - - spin_lock_init(&pmlmepriv->lock); - rtw_init_queue(&pmlmepriv->free_bss_pool); - rtw_init_queue(&pmlmepriv->scanned_queue); - - set_scanned_network_val(pmlmepriv, 0); - - memset(&pmlmepriv->assoc_ssid, 0, sizeof(struct ndis_802_11_ssid)); - - pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); - - if (!pbuf) { - res = _FAIL; - goto exit; - } - pmlmepriv->free_bss_buf = pbuf; - - pnetwork = (struct wlan_network *)pbuf; - - for (i = 0; i < MAX_BSS_CNT; i++) { - INIT_LIST_HEAD(&pnetwork->list); - - list_add_tail(&pnetwork->list, &pmlmepriv->free_bss_pool.queue); - - pnetwork++; - } - - /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ - - rtw_clear_scan_deny(padapter); - - rtw_init_mlme_timer(padapter); - -exit: - - return res; -} - static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) { kfree(*ppie); @@ -290,9 +236,54 @@ u8 *rtw_get_beacon_interval_from_ie(u8 *ie) int rtw_init_mlme_priv(struct adapter *padapter)/* struct mlme_priv *pmlmepriv) */ { - int res; + int i; + u8 *pbuf; + struct wlan_network *pnetwork; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; + int res = _SUCCESS; + + /* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */ + + pmlmepriv->nic_hdl = (u8 *)padapter; + + pmlmepriv->pscanned = NULL; + pmlmepriv->fw_state = 0; + pmlmepriv->cur_network.network.InfrastructureMode = Ndis802_11AutoUnknown; + pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: pasive. Maybe someday we should rename this varable to "active_mode" (Jeff) */ + + spin_lock_init(&pmlmepriv->lock); + rtw_init_queue(&pmlmepriv->free_bss_pool); + rtw_init_queue(&pmlmepriv->scanned_queue); + + set_scanned_network_val(pmlmepriv, 0); + + memset(&pmlmepriv->assoc_ssid, 0, sizeof(struct ndis_802_11_ssid)); - res = _rtw_init_mlme_priv(padapter);/* (pmlmepriv); */ + pbuf = vzalloc(MAX_BSS_CNT * (sizeof(struct wlan_network))); + + if (!pbuf) { + res = _FAIL; + goto exit; + } + pmlmepriv->free_bss_buf = pbuf; + + pnetwork = (struct wlan_network *)pbuf; + + for (i = 0; i < MAX_BSS_CNT; i++) { + INIT_LIST_HEAD(&pnetwork->list); + + list_add_tail(&pnetwork->list, &pmlmepriv->free_bss_pool.queue); + + pnetwork++; + } + + /* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */ + + rtw_clear_scan_deny(padapter); + + rtw_init_mlme_timer(padapter); + +exit: return res; } -- 2.30.2