From patchwork Fri Dec 30 17:53:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37723 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3002897wrt; Fri, 30 Dec 2022 09:56:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXsfnNtpNcS+zHQt32hnMpBlg8l7yy7LMJMjGnydE6nm1Vn7DuPNwl4aoVlEFc3tUOrysaxF X-Received: by 2002:aa7:dd13:0:b0:463:ba73:9139 with SMTP id i19-20020aa7dd13000000b00463ba739139mr25634579edv.2.1672422994970; Fri, 30 Dec 2022 09:56:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672422994; cv=none; d=google.com; s=arc-20160816; b=QM+/AMmpJWusx+wFNUHf0xOuxyp28VqqoGoZz1W3JUd30lBHW8KVBt3n9Rlabxj6KM gLIvwd4lrVr7cGSjh3699TchVzBWp1dI+r08Pp36f0NQaesHR3DYgOopVOJte/VvgvA3 NPAY1kgfc8cnUJxBy3GCGIHhB8voYHPAHp8a3w7MGM1B3WnuoKt67HxYQky0CXZL9KiL YnQ4mdRWiUDWYkLK5c3Eg3OnI7ND+UaL9UuI+cfBL6i16Sd9C5OfkAo89yCKBPkYtBgz 6MTxk/W2ZeMTBiSGGxpPVWRo2p7VUo6LB4E4LWDWRNgbLX/YSkynI/I7iKuK67Cip7E1 EEeg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n11-20020a05640206cb00b0046ce55c0f98si17886626edy.111.2022.12.30.09.56.10; Fri, 30 Dec 2022 09:56:34 -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 + 99 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 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?1753662614463367694?= X-GMAIL-MSGID: =?utf-8?q?1753662614463367694?= 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) From patchwork Fri Dec 30 17:53:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37724 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3002990wrt; Fri, 30 Dec 2022 09:56:53 -0800 (PST) X-Google-Smtp-Source: AMrXdXt1MbfGb3T3N7JU8WIqT+cAHuYYb4ApPxuiBA9dfj3BrQ19BReh1PzNytAtL3JxopimWtI1 X-Received: by 2002:a17:907:a508:b0:7c1:539b:d028 with SMTP id vr8-20020a170907a50800b007c1539bd028mr27452904ejc.48.1672423013328; Fri, 30 Dec 2022 09:56:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423013; cv=none; d=google.com; s=arc-20160816; b=AE08mQDpnp1CLLQWsBhx5fVNiaBiqiG7muSJShkwV3lqt2N7rOKpjMuxt7/dRf4Mp7 5rdemE340XeeJqikoCNS1IW2uTg/cBtW58Eo7Cz35nVt2P0YUmuFZdgniUTcQU1rdT6l t2QKTrn4wnRiOIjGTHg1qYTV+xzWpyCdANwou0TYUW6Qmm2JSFsuAqEiEJcrq8Puw6/H f5DEVM13Y+5gGDD7Dl6uo8tseb7JolCX+19a9VByLum+sx6GhoG3X0e0Uuuz0DpMX49C EQehHxNYLLsYnNt8M/Rf0urYXMH4D5m3Akp709GUItsKWWbOXPKUZab03UVcFp9ycaaV fLJg== 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=DwTGHAanvjIWQP3TIhIhgf8SfUxNM4oKxZHGoexu1MY=; b=Q+mo67YBm7/ejlZxhhpiaLw8BS8xWDIrCImQS/YfXEFi5RylGfjqnmaAXuhrf6ausO F5r8wwbsnMIJ70DQSoDpxqf4gdd0U5K07m/utKzMgF7KFdOPG4+B3YBhaXsXJ1Ifi2Jn nmqYFedw1XmH+WMDczzBhm3+xd/qKngyznFoA/SRhmXgIch5l9QHCPmKgoaBVc2PYipL I8s8UQNtSM1b0dJWvr0jUeg0+dP+pDL9nMeZnX3ogqDMxFOx8B1dA2P3KVe+kpruasBy fnuMkBlAoM0w43MT5hZVsBLqkBord7TlwcOLVxQDJS0S9pk/AQkTHhZ01YbCJqhlgkg6 nCFQ== 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 cs18-20020a170906dc9200b008366ae33ebbsi20473232ejc.562.2022.12.30.09.56.30; Fri, 30 Dec 2022 09:56:53 -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 S235071AbiL3RyF (ORCPT + 99 others); Fri, 30 Dec 2022 12:54:05 -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 S235124AbiL3Rx6 (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 405BD1C400 for ; Fri, 30 Dec 2022 09:53:58 -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 1pBJZo-0004hN-8d; Fri, 30 Dec 2022 18:53:52 +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 2/4] staging: r8188eu: merge on_action_public_default into its only caller Date: Fri, 30 Dec 2022 18:53:24 +0100 Message-Id: <20221230175326.90617-3-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 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?1753662633408983360?= X-GMAIL-MSGID: =?utf-8?q?1753662633408983360?= Merge on_action_public_default into on_action_public, which is the only caller. Yet again, this makes the code a tiny bit smaller. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index cfa65813d3f2..0b2f5d6c1279 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3735,29 +3735,20 @@ static unsigned int on_action_public_p2p(struct recv_frame *precv_frame) return _SUCCESS; } -static void on_action_public_default(struct recv_frame *precv_frame) -{ - u8 *pframe = precv_frame->rx_data; - u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); - u8 token; - - token = frame_body[2]; - - rtw_action_public_decache(precv_frame, token); -} - 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); + u8 token; /* All members of the action enum start with action_code. */ 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); + token = frame_body[2]; + rtw_action_public_decache(precv_frame, token); } } From patchwork Fri Dec 30 17:53:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37725 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3003001wrt; Fri, 30 Dec 2022 09:56:54 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjszIHl410fcrTGFnm1PwS4HEqifigS8fpFIOXpt01iZOBRqaO754k4X8CXt1Z89Ts+711 X-Received: by 2002:a05:6402:5145:b0:475:32d2:7486 with SMTP id n5-20020a056402514500b0047532d27486mr29456918edd.31.1672423014609; Fri, 30 Dec 2022 09:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423014; cv=none; d=google.com; s=arc-20160816; b=rXVDd1b8mYEUvz74dEqIJDo7BEkZO88KhtzEE/ZsCsjDV8dF+EfrWmweUjJRlINTXw Vwypt2WpIEY8YRkREPnlmKgYf7ndnJAhbJv6KXKmJljra3tOmZnRRmSXRsquauTgkGQy +cBZPBRTtYqvVrmIUu+FxBuTKEMRr3molhu1l1p1pO3BnrlUcy83BIcw+7BN/SKXZqdK N1vspArRWQ3fnoTj9kIvH40jbqbhP5vWC0Mh2VUvXbXzo2PTogM4AJNgXczmWLnpaao0 ebNGJjEz3MesZROCcSVuBmmmqXTCiXdEJIHYG++6f2+6c9pACA/IS0DqPx8B3GYSjni7 Uy/w== 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=LYdEmGJv0lxWfkAx1zB5deNY7o1DdSOweCd+DCAayc8=; b=hAF9+URG2l8bzr7m5YOliDdqaYB1iM8CphbAy+kRzzDedW65DW72xvsIUUNrDGTTd/ /2I/tSGhiGTSE5nhRChnxKAn1hO37TRWd4XXXsRjidwkRQb6Gk+xScOZFZQXkOiUGv/k /enVFUDCz9lnB6iQn9e1ylytLYKHv+dzEMOzNnaeDle/nhMfXJsWA3DM/Lu/miFJMSHZ puwKEQQroj3YIjraKHunQqZG7Hly61WOA07FA16CmyxT0TIJjPskc9R4fzxEz2iRwRNs T/8KjwCvV/ODMgpeGGjlApGhdxKENqm/MQQ+KJ92N8cVi9sYnyoddg0ZBR0HYC4FRRdI 39XQ== 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 dz10-20020a0564021d4a00b0047b79b99e52si677543edb.567.2022.12.30.09.56.31; Fri, 30 Dec 2022 09:56:54 -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 S235397AbiL3RyJ (ORCPT + 99 others); Fri, 30 Dec 2022 12:54:09 -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 S229530AbiL3Rx7 (ORCPT ); Fri, 30 Dec 2022 12:53:59 -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 0FFEAF1C for ; Fri, 30 Dec 2022 09:53:58 -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 1pBJZp-0004hN-0t; Fri, 30 Dec 2022 18:53:53 +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 3/4] staging: r8188eu: remove intermediate pframe pointer Date: Fri, 30 Dec 2022 18:53:25 +0100 Message-Id: <20221230175326.90617-4-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 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?1753662634893916120?= X-GMAIL-MSGID: =?utf-8?q?1753662634893916120?= The pframe pointer in on_action_public is used only in the definition of frame_body, which points to the payload of an incoming action frame. We can use mgmt to locate the action payload and remove the pframe pointer. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 0b2f5d6c1279..310e60c4b639 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3738,8 +3738,7 @@ static unsigned int on_action_public_p2p(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); + u8 *frame_body = (u8 *)&mgmt->u; u8 token; /* All members of the action enum start with action_code. */ From patchwork Fri Dec 30 17:53:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37727 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3003635wrt; Fri, 30 Dec 2022 09:59:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXt9cDaWKEE6tAxbg3nzn/lonoUEEYRh/wPUWDrE9Lc140wGzvgvKl9BYiQ3DU4iWbaayVmY X-Received: by 2002:a17:902:ec89:b0:18b:ed3f:c6ca with SMTP id x9-20020a170902ec8900b0018bed3fc6camr47978709plg.12.1672423161059; Fri, 30 Dec 2022 09:59:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423161; cv=none; d=google.com; s=arc-20160816; b=EN4G4dU94/hinbekAfM7QrL14sT0qVZpkrAqv0vMnrq6AudpdXWQ+cGrYJUXpUovZo eznuMPX/tUXTnrOaIQW1I/u+wmxXa+LC7T2FPvGsDvCBJUvVgJXvY6czB6Btf0G0/r/0 U9DucNgBhjuzczJOL9vHP69BR4firCGyv+xhR/qKg3p00bxkDxMSqB3d4LM9bvyCOz4o g0ZFVtJjwKVKuKFOQ7C3IBdI4fR+5sK9my1hBgsAOPiXqJHvs0oLJfK3klvl5sA9dCHI 86x/D0qG16Li8zTvXlocguDp4RDRdZmzs2QleQNScTWN6qRgF30ydTX7PqMSocFTT5tQ ercQ== 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=5moOgHWfmG8oZCupRjDVF/yfdc0UL4D+eFK4lEJbBGg=; b=EaAchEImFl8lBgddHU6ev63gKunEC0AOmTeOSMbx5cSpaWroHCVSZC3xFaBq6jzmcT BE9oiAjFlOFajAy4qL8CokDZW6/6jGc8ijAE48CaoelDJYIJqNUYzCxbmONKf706cA2U iTyAOFMbA5Y6FLOEyIM1nLpfDA7+R7kNR0pVtBp+kO2Jm2bm79GnbzCFWtHCVz1apApT rCBjRku/tMfqfj5RnE2qjI/JyQ23r7dTUKCZCGa/DNmQV/w/ZjPsC2wcEUgFgiFaaEOg b/wzACbbQ4LL2kEwgk25ganYwVNeC4fsBUFfhd+aR3iseS7+RXmy1Q9MRE8C/Y+NsGIH g2cA== 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 v1-20020a170902b7c100b0017336c464ecsi21334841plz.407.2022.12.30.09.59.08; Fri, 30 Dec 2022 09:59:21 -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 S235247AbiL3RyO (ORCPT + 99 others); Fri, 30 Dec 2022 12:54:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235279AbiL3Rx7 (ORCPT ); Fri, 30 Dec 2022 12:53:59 -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 3CC0E1C40B for ; Fri, 30 Dec 2022 09:53:59 -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 1pBJZq-0004hN-0s; Fri, 30 Dec 2022 18:53:54 +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 4/4] staging: r8188eu: remove intermediate token variable Date: Fri, 30 Dec 2022 18:53:26 +0100 Message-Id: <20221230175326.90617-5-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 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?1753662788717173680?= X-GMAIL-MSGID: =?utf-8?q?1753662788717173680?= Remove the token variable in on_action_public and use frame_body[2] as function parameter. This saves another few lines of code. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 310e60c4b639..dc181e491b34 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3739,15 +3739,13 @@ static void on_action_public(struct adapter *padapter, struct recv_frame *precv_ { struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)precv_frame->rx_data; u8 *frame_body = (u8 *)&mgmt->u; - u8 token; /* All members of the action enum start with action_code. */ 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 { - token = frame_body[2]; - rtw_action_public_decache(precv_frame, token); + rtw_action_public_decache(precv_frame, frame_body[2]); } }