Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp1218452pxb; Thu, 14 Apr 2022 00:41:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTYptI0wg6jzzKPy7OwBLFmyGWsrs0KsESFIDyzI3zKSUvFb3k6Leg3mZpwm+Ln1YI9v6j X-Received: by 2002:a17:90a:2983:b0:1cb:8d6e:e10b with SMTP id h3-20020a17090a298300b001cb8d6ee10bmr2352265pjd.208.1649922066843; Thu, 14 Apr 2022 00:41:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649922066; cv=none; d=google.com; s=arc-20160816; b=feEgKtfwIOe/L/elcv8ZWCBAvAuzMkXKEjeNGdUFHHeMhR2CWzKp6pxhce5jIQScV0 Mj9yBTzqzKd98napEk3tsPRFElVw0n+RT9hSyj8goO/td9TUKrRm4htmLH02b8J4ww2Q 6GixVrdSEQNRv7OxcLiYwsJhqjiL4S3Eb6kHkh9RniU0f7HmpPtrombkxEy/XsSyrg+x 7wjdWF8Se6f2VWo2j085LPlMyp3hA5LLUQEJDQPxk44zSfYUZR6vZ17VwetSXAW4Ml3J CfOwTu3VoCtjMWZL/myholkHolDsG0ri1nND2BaBdCR5YpxjySDECkOo1vfdDE5+iKY+ yRFQ== 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=BaSQY/rJbDIonEe3W9yT+R3ZvKUOhXuE6ks7KCV6waw=; b=fDHU57F2Bd9e/pttZNCd/B585v54smlJvUkG73VMQu8m4jwPUz9G+85HF9NT6CKvxR IkX50ge/1RUdkBJleFGxFC1PajKbltJnHWKSI95UpbK4dT/xKXQ7291uvGWmgcdoxLoO qJYcV5Y7Adqc/Wm8/RImawX8DZIedIQAuBwXTgS2QuQYLL4Zl4Dl3BH+TtqMUhyBId7w kI5WmMD+Tf7eeEYt387Vs6MLkJBHi4e2d1U/WL5UCDQtbcE/TOvSHhOMYQpMUur5RGux v317tP1sr/+pfTPJMQRqiO6DxBIeZnZz+UpuxxyLMksEIpGocgZvHuHs9WwGJO1K1eR0 duXQ== 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 r34-20020a63fc62000000b003989e3ed584si7326162pgk.856.2022.04.14.00.40.53; Thu, 14 Apr 2022 00:41:06 -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 S238422AbiDMUK1 (ORCPT + 99 others); Wed, 13 Apr 2022 16:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238184AbiDMUKQ (ORCPT ); Wed, 13 Apr 2022 16:10:16 -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 289757CDCF for ; Wed, 13 Apr 2022 13:07:54 -0700 (PDT) Received: from dslb-178-004-174-121.178.004.pools.vodafone-ip.de ([178.4.174.121] 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 1nejHK-0005wN-Jr; Wed, 13 Apr 2022 22:07:50 +0200 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/4] staging: r8188eu: merge _mgt_dispatcher into mgt_dispatcher Date: Wed, 13 Apr 2022 22:07:40 +0200 Message-Id: <20220413200742.276806-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220413200742.276806-1-martin@kaiser.cx> References: <20220413200742.276806-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,T_SCC_BODY_TEXT_LINE 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 All that the _mgt_dispatcher function does is to call a function from a function pointer. It's not worth having a separate function for this. Merge _mgt_dispatcher into mgt_dispatcher. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 22 ++++++++------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 66dd06371991..ba071de4c05c 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -390,19 +390,6 @@ void free_mlme_ext_priv(struct mlme_ext_priv *pmlmeext) } } -static void _mgt_dispatcher(struct adapter *padapter, struct mlme_handler *ptable, struct recv_frame *precv_frame) -{ - u8 *pframe = precv_frame->rx_data; - - if (ptable->func) { - /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ - if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && - !is_broadcast_ether_addr(GetAddr1Ptr(pframe))) - return; - ptable->func(padapter, precv_frame); - } -} - void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) { int index; @@ -442,7 +429,14 @@ void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame) else ptable->func = &OnAuthClient; } - _mgt_dispatcher(padapter, ptable, precv_frame); + + if (ptable->func) { + /* receive the frames that ra(a1) is my address or ra(a1) is bc address. */ + if (memcmp(GetAddr1Ptr(pframe), myid(&padapter->eeprompriv), ETH_ALEN) && + !is_broadcast_ether_addr(GetAddr1Ptr(pframe))) + return; + ptable->func(padapter, precv_frame); + } } static u32 p2p_listen_state_process(struct adapter *padapter, unsigned char *da) -- 2.30.2