From patchwork Sun Oct 30 17:33: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: 13028 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1894510wru; Sun, 30 Oct 2022 10:37:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5MyQVbPZcvUzx/zjlM59lfTxIey3Wt5uW65xLCfbiAUc3L8clBFXaTyS5cZnqSTzvpM0PX X-Received: by 2002:a17:907:7d8b:b0:78e:2534:4fd3 with SMTP id oz11-20020a1709077d8b00b0078e25344fd3mr9327685ejc.141.1667151441408; Sun, 30 Oct 2022 10:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667151441; cv=none; d=google.com; s=arc-20160816; b=P4vGpL6jheRaso+Wjqxq9UuK8ll2r3apG2s8xvutEwogYGMhDYOyyh7A/p4X+msURE Yw3Lbqtz/8jFSGsfT3U7AP279WbTMHFKVT67rCbqBCArp9cbHPzDaOYt5FagbWlwztMa 8xYsaRCJp8brTHNiHl04cN4/ne199PZo2zLpGlEfZIV74zbFmIn2Brr6w2mhLIjvcLkS FpU7PDY8HhHY9WVsEl52U4BJzMHX7tUyvJTzz7bvo/B/uP6zlx3qoX+4TWRnPlViJK46 fkiMRsD6D438TU4ND0i8DJMcqVx592W+GZg7rWBrswxoXiHqBohJSRIe43LopXCkVcnQ LMow== 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=N8k5BQiASjLfk9ZeQkhld1UxXUO9WHtld1W1SEJUdg8=; b=0inDNG5nBncGQoAmfMIPiBBSCMaxWsynIblZlZeZ5En+TFFtGaqjFXTzI7WDS0n6nP kgng+QwQ3sDk2OpthnEYn49p/byTzwK8BufrWVx9p734DJ2816NWDazq/BMzI+f0jCZE u0/iDZCqSpBoTJudhqK4r+DgvDcelPfp5vY399nX2tOY4oyznoV8dV0vj7aaOwVnH+u6 6Mi2Jvgbfw3EjVw/V6kh3IYhfrsQAGKwjTUvQXX4Jtw2YJQLLy5YrdwDvXauzp+yx82L 0rX9b+ccMRxebHqE/N8WOne6LDLXFrK3xBMl5xrnFIy3fx8mDNp/TU0im6oq8Yvoiypd pQoQ== 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 y19-20020a056402441300b00456d901922bsi4839770eda.510.2022.10.30.10.36.58; Sun, 30 Oct 2022 10:37:21 -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 S230003AbiJ3Re2 (ORCPT + 99 others); Sun, 30 Oct 2022 13:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiJ3Rdy (ORCPT ); Sun, 30 Oct 2022 13:33:54 -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 8D59895B4 for ; Sun, 30 Oct 2022 10:33:53 -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 1opCBy-000469-8K; Sun, 30 Oct 2022 18:33:50 +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 12/13] staging: r8188eu: rtw_action_public_decache's token is a u8 Date: Sun, 30 Oct 2022 18:33:25 +0100 Message-Id: <20221030173326.1588647-13-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?1748134989472255612?= X-GMAIL-MSGID: =?utf-8?q?1748134989472255612?= Both callers of rtw_action_public_decache pass a u8 value for the token parameter. We can change token from s32 to u8 and remove the code for token < 0. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_mlme_ext.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_mlme_ext.c b/drivers/staging/r8188eu/core/rtw_mlme_ext.c index f5923792f067..93f3d387e92d 100644 --- a/drivers/staging/r8188eu/core/rtw_mlme_ext.c +++ b/drivers/staging/r8188eu/core/rtw_mlme_ext.c @@ -3490,7 +3490,7 @@ inline void issue_probereq_p2p(struct adapter *adapter, u8 *da) _issue_probereq_p2p(adapter, da); } -static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) +static s32 rtw_action_public_decache(struct recv_frame *recv_frame, u8 token) { struct adapter *adapter = recv_frame->adapter; struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; @@ -3499,21 +3499,13 @@ static s32 rtw_action_public_decache(struct recv_frame *recv_frame, s32 token) (recv_frame->attrib.frag_num & 0xf); if (GetRetry(frame)) { - if (token >= 0) { - if ((seq_ctrl == mlmeext->action_public_rxseq) && - (token == mlmeext->action_public_dialog_token)) - return _FAIL; - } else { - if (seq_ctrl == mlmeext->action_public_rxseq) - return _FAIL; - } + if ((seq_ctrl == mlmeext->action_public_rxseq) && + (token == mlmeext->action_public_dialog_token)) + return _FAIL; } mlmeext->action_public_rxseq = seq_ctrl; - - if (token >= 0) - mlmeext->action_public_dialog_token = token; - + mlmeext->action_public_dialog_token = token; return _SUCCESS; }