From patchwork Sun Oct 30 17:33:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13019 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1893868wru; Sun, 30 Oct 2022 10:35:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM74iCD0xP6PJfCgniorZxyu2HUSyv9l5mmsj9WD994fQy+WeyuVu55cLTJ+IH9+5/GQDLqp X-Received: by 2002:a05:6402:5406:b0:452:1560:f9d4 with SMTP id ev6-20020a056402540600b004521560f9d4mr9767049edb.333.1667151336293; Sun, 30 Oct 2022 10:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667151336; cv=none; d=google.com; s=arc-20160816; b=HN+tPU26y3bviN39mIA2+D4pV2lEbntWFyGjvy5obVyYsLBm28PSNRN/BEtsAXeKsM 1GNrvMx0tJ53yyqypZJZ+A144oKX7tv8zP+cV0Sg3UN4ZluJYHeNjAg2KNbe6Klvzejl uFDbrDHT89oMy381JzxQ/GVIzeQiE1NkaOpgKJHyxHeGSHThdwejKIh3ptv0o8kSox8I QqTsEOHBLSfJciKr+oZKKkSU6DWJgL/sIDPf0zfx8FOTXnLztR38zGv7eI21jeF0wzDW gj+8gPs36dSii5bnkukMNdIfkfL8L7QrZhGrTQfKr4EZfk0+B5EHtF4iElwg2EFo3QmT WqVg== 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=AmFUpuVUJtAnqL6dDo6a7tfNMImQjUJ3qY3TtanJWf7rIEIbBl6Y2t1GZrQ2nVSLIb x2yB16ZAfyq80Mt3RyJvzfGz1APXjvTWGmJNJCjY8uoRqV/ehuDFyAbxUkrDH7b0VxQf PWGzjrZXmUKcMcPiDxZld6Y8ZwGUZ94BwVsA322BBg4tRA1pebW3CEEWftcD69PElqlY oaqSFV1rkXvBVE1nJChuZtfx2/iLTgC3xJ17aRgQaS4/3NM8wf8CuARtBXhFnBMaOgQF aDCFZ7RUcv7oCp5ibsIlm//0qJ2tkW6muH1B6KRWSJ9+clTaXG8+t3iHDi7b0bwUPf2w Rd9Q== 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 v8-20020a170906b00800b0078d23ac6981si3924759ejy.790.2022.10.30.10.35.13; Sun, 30 Oct 2022 10:35:36 -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 S229968AbiJ3ReB (ORCPT + 99 others); Sun, 30 Oct 2022 13:34:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbiJ3Rdv (ORCPT ); Sun, 30 Oct 2022 13:33:51 -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 3B688A44C for ; Sun, 30 Oct 2022 10:33:46 -0700 (PDT) Received: from ipservice-092-217-067-184.092.217.pools.vodafone-ip.de ([92.217.67.184] 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 1opCBq-000469-If; Sun, 30 Oct 2022 18:33:42 +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 v2 02/13] staging: r8188eu: remove duplicate category check Date: Sun, 30 Oct 2022 18:33:15 +0100 Message-Id: <20221030173326.1588647-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221030173326.1588647-1-martin@kaiser.cx> References: <20221030173326.1588647-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?1748134879404865532?= X-GMAIL-MSGID: =?utf-8?q?1748134879404865532?= 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: