From patchwork Sat Oct 29 17:23:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 12761 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1439980wru; Sat, 29 Oct 2022 10:27:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hrXp23JgQ5JJEjyCu/FwZnprvAUUw6DP1JzvZKwjeTF7ijFV95lq3yslHi3tR308CO24A X-Received: by 2002:a17:902:ec86:b0:185:483e:e4ec with SMTP id x6-20020a170902ec8600b00185483ee4ecmr5381985plg.164.1667064421571; Sat, 29 Oct 2022 10:27:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064421; cv=none; d=google.com; s=arc-20160816; b=P7Kz8wTtHA4LVucshBKfEnAqpdcILt/JkiQhQ6e3TDxYWOsVOQSRZxlIsAnBaipy1G nOVI+bsz5OlOyUp26votGVybdRRUTJLgihGUweNkABWxgbcVn6jrWY1HHq0C2ieo7x79 MiY3ry08bm6RoJaWdcSRP4F5fOBBUc4XnwZGH6c7HwUD6w4an+FVXO0uWwpirQnrgNxe MkIsJE4zQQOGJvo2UnWcQr1ZB/N9EH//nXjBzl8cM5mbooHJeV0Mn1YjQvoi9uhXXW7D J/bGBboqXsXbZKTtBmftuF86dSGGy/MWjtSS7T/vXsiSzMisMHuxYBOTCCtUyP6HNEFt f5Lg== 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=rD1fZaH5YD6mwh6DI16dPGsg6F5TtfwIRT9P7RRiafOZcUwoaM6femIyj2JQSvuiGb L2rJWJtZKl45Y5n1uL2DdkO7ubOxHxPqKoW+pagB3WnYaLDFpPvcRkDDOTsVteEBB1Vc 0z/5mq6R/hiGxs6KNsc0aoKnMzboXhJfoVwVTKWkBjiQsIrohK3CGkKcEkHSZg/uVl9/ v7QxN3Bidj8/1EZT0UJjZ7ocvJHmfChZNEfYhEfDGsabGTl8ABj/EHtWwXiG+f+wNm+v hnpw9AnzxrRE4oZ5TtgTVro3bNnCvBif8Ggd/994MqmtkT8AHhHsM4dfl42NdJf5TbjJ drcg== 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 q128-20020a632a86000000b004599da2b2b6si2634634pgq.716.2022.10.29.10.26.49; Sat, 29 Oct 2022 10:27:01 -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 S230005AbiJ2RYm (ORCPT + 99 others); Sat, 29 Oct 2022 13:24:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229862AbiJ2RYO (ORCPT ); Sat, 29 Oct 2022 13:24:14 -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 53D8941510 for ; Sat, 29 Oct 2022 10:24:07 -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 1oopYw-00074v-SJ; Sat, 29 Oct 2022 19:24:02 +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 12/13] staging: r8188eu: rtw_action_public_decache's token is a u8 Date: Sat, 29 Oct 2022 19:23:36 +0200 Message-Id: <20221029172337.1574593-13-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?1748043743092077916?= X-GMAIL-MSGID: =?utf-8?q?1748043743092077916?= 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; }