From patchwork Sat Oct 29 17:23: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: 12753 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439599wru; Sat, 29 Oct 2022 10:25:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM78vpU547pWIvEdpAAhwWrz4L1vYrL+S4ZJ0cLDRcXY/87V55BT1PtHP1Akr5r17QEG3Cpu X-Received: by 2002:aa7:9212:0:b0:562:b5f6:f7d7 with SMTP id 18-20020aa79212000000b00562b5f6f7d7mr5402915pfo.70.1667064339955; Sat, 29 Oct 2022 10:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064339; cv=none; d=google.com; s=arc-20160816; b=Cp5x4/ZntRu7YYqmMoc0HA4Q1NxV3DAHxI+U/0Chr8wZSSGxEp90WM2zoGnYneag0B +yi7Tm9YtQljwPaHXNdPH0pctxX54rr4OlJYr//vAcNXAblMdtXMJStDHdRl2/3A3M4A n3ezw00GRuDW4q28KacwBm/APgnMx7b39ukAIGh4mv9EKSLA0vaGlCIIjrdyhcj11bhb ViqejsqnBK+pMo3Ug6Ky9L1sn3144z6mmn6iiNp8ibbvfGrf6J+mDmVlsNDA+BmnBAIc KMmMDb23lnHb//lzcc3mqm50+v2l/7ADbAPoVCBSRCQc5YLxeDWuCEVjj5Ri2hodiejk 7uHA== 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=c/etGoh4+SPCqPzmtQ82eLnf8KVfmpLT/m+vzxeS/9Y=; b=unIj9r9+tg0ftI9zdpChAVbHf9VgjST/l/T6vzY/4/lqvQJtqPC+xvGpxzKMi+/kXb pLtYC2K9dyJp6f8IEBGi2+YGnJD1US8iHzaMO/3tagu2zSKs+LZLyJXGTjhkGU++uzW0 eO9EPU4W3Ev/ghi6zHYVkaKVDZFIlHbfrZTDN2ZKlyYKjGr09JPK008gyxJA7xkckQz9 tRRPCFnIQBzj+DQfvaFgcG/AKAngvrZw78ieCNkDYrXdRHpAaU/CY1CK2ZrufRW+szAZ Z7kU950Q5wQy9YE6qmlI05PcutrQn1xjUYV/HAVO4WVJXQZrkJwfdW3OS9i2wl3rgOxx qk9w== 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 f21-20020a056a00239500b00543bb97c41esi3001907pfc.30.2022.10.29.10.25.27; Sat, 29 Oct 2022 10:25:39 -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 S229919AbiJ2RYU (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229727AbiJ2RYH (ORCPT ); Sat, 29 Oct 2022 13:24:07 -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 8353840E11 for ; Sat, 29 Oct 2022 10:24:00 -0700 (PDT) Received: from dslb-188-097-213-253.188.097.pools.vodafone-ip.de ([188.97.213.253] 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 1oopYo-00074v-QI; Sat, 29 Oct 2022 19:23:54 +0200 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 02/13] staging: r8188eu: remove duplicate category check Date: Sat, 29 Oct 2022 19:23:26 +0200 Message-Id: <20221029172337.1574593-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221029172337.1574593-1-martin@kaiser.cx> References: <20221029172337.1574593-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?1748043657318653479?= X-GMAIL-MSGID: =?utf-8?q?1748043657318653479?= The caller of on_action_public has already checked the action category. We can remove the check in on_action_public. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index 5a366688a3f7..7d4f208d161b 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3819,16 +3819,12 @@ unsigned int on_action_public(struct adapter *padapter, struct recv_frame *precv unsigned int ret = _FAIL; u8 *pframe = precv_frame->rx_data; u8 *frame_body = pframe + sizeof(struct ieee80211_hdr_3addr); - u8 category, action; + u8 action; /* check RA matches or not */ if (memcmp(myid(&padapter->eeprompriv), mgmt->da, ETH_ALEN)) goto exit; - category = frame_body[0]; - if (category != WLAN_CATEGORY_PUBLIC) - goto exit; - action = frame_body[1]; switch (action) { case ACT_PUBLIC_VENDOR: