Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7579659rwl; Fri, 30 Dec 2022 10:32:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXuWFYARSp0eoKSx9sWcELdnBfI8lxn4KG5Nz6cSyrQIegpZRiVo/OiqQJy/tL21iVPSJYXU X-Received: by 2002:a05:6a20:4da4:b0:af:98cd:9dd4 with SMTP id gj36-20020a056a204da400b000af98cd9dd4mr33041546pzb.15.1672425121589; Fri, 30 Dec 2022 10:32:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672425121; cv=none; d=google.com; s=arc-20160816; b=fAPURtxvA8ZSywfYpSmoEpzE03AAze3V742yRS2B0MVCstYIozEtLTFPEQtbRd2s69 QwRqSHvO56KAwKQcTnSj6N6Q86YjNwYlwA8YmRgPCI3huTXRidw9V3vHUuMIjfDOKj4H dZRJ+nDF5gu8gg+UeboQQ9sJghb0pqY8+gmifPY/UnBdQ3eu3S7aJJQQz2UDryMkDZsi thMy29k+9anrLepsO8xT1hcXbnAQnuC/kTgsCjF3M65qtPXwJE0qfHdfHJ+xHqbCcgAz haXXn7/ltm33Qck+jjL92gH+rgTuy7TYAv0xGw10Gq+n9OkGgIjPDmquXuEXo4wMp6em P0wQ== 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=cNwB20311erm5AGMTA3dYSr7Pf+hUwoZDM4+tTPL5Ek=; b=NR1g77WLpbT9hkrmUR0N+rSktGkadyehVCI0y1C/6zJMa7Bl4bp5EQGPkHceOrpToO Vr/DautCMQCPIwVcskwfiPmj2/ghODpF7q4A4pOvScLIML/fa8jPbqBt8FOjNufyfAWc 7BqebEJh1OBpu2UslleWQHMNL1OTX+JwVFIqGqeL460jPb/7c0riDnH7bZsnfgqM0pT8 y8f25Lx6WKL3WgCkMQsVglrdt8LARBO14r9NU64Sj6L0tf15Bq/MVNQ3r9sJ0UYWEQV6 Le6S9+3pVz8qgCSseiwt3C+nJkGhhRkhL5Yrb7UHYggXYAT3FmTOU9hyyJLx2vuq6Gon NKKg== 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 s70-20020a632c49000000b0049d000c59desi7269615pgs.553.2022.12.30.10.31.53; Fri, 30 Dec 2022 10:32:01 -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 S235393AbiL3RyC (ORCPT + 63 others); Fri, 30 Dec 2022 12:54:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235130AbiL3Rx6 (ORCPT ); Fri, 30 Dec 2022 12:53:58 -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 7FC302DD7 for ; Fri, 30 Dec 2022 09:53:57 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJZn-0004hN-C2; Fri, 30 Dec 2022 18:53:51 +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 1/4] staging: r8188eu: merge on_action_public_vendor into its caller Date: Fri, 30 Dec 2022 18:53:23 +0100 Message-Id: <20221230175326.90617-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230175326.90617-1-martin@kaiser.cx> References: <20221230175326.90617-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 Apart from declaring variables, on_action_public_vendor is only an if statement. Merge this function into its only caller. This makes the code a tiny bit smaller. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 1b9cf7596a76..cfa65813d3f2 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3735,15 +3735,6 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) return _SUCCESS; } -static void on_action_public_vendor(struct recv_frame *precv_frame) -{ - u8 *pframe = precv_frame->rx_data; - u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); - - if (!memcmp(frame_body + 2, P2P_OUI, 4)) - on_action_public_p2p(precv_frame); -} - static void on_action_public_default(struct recv_frame *precv_frame) { u8 *pframe = precv_frame->rx_data; @@ -3758,12 +3749,16 @@ static void on_action_public_default(struct recv_frame *precv_frame) static void on_action_public(struct adapter *padapter, struct recv_frame *precv_frame) { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; + u8 *pframe = precv_frame->rx_data; + u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); /* All members of the action enum start with action_code. */ - if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC) - on_action_public_vendor(precv_frame); - else + if (mgmt->u.action.u.s1g.action_code == WLAN_PUB_ACTION_VENDOR_SPECIFIC) { + if (!memcmp(frame_body + 2, P2P_OUI, 4)) + on_action_public_p2p(precv_frame); + } else { on_action_public_default(precv_frame); + } } static void OnAction_p2p(struct adapter *padapter, struct recv_frame *precv_frame) -- 2.30.2