Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp766857rwj; Sat, 29 Oct 2022 10:27:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wqPNus1gn9lD6g9zOgiQcu0i9VxUW7+uRdNryziNZU5JQO4tEtSoIYKTfenrWDXzEW9dq X-Received: by 2002:a17:90a:be14:b0:213:c304:1d68 with SMTP id a20-20020a17090abe1400b00213c3041d68mr959663pjs.80.1667064446478; Sat, 29 Oct 2022 10:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667064446; cv=none; d=google.com; s=arc-20160816; b=YyNJsVl/xlwAjlzazVhzBae74blNb8bK+2tAWCSMOIzpulLoqONErDErzONglS5Rl2 jAy7lpjCu8k1yEz+0aNXuAed9cXAVOdDwPh0A/hdt0MNJE7ei3quZLKCCRYHT7N8opkg ha6CiXPd11PwkQRiKOvI97i5v2euiKVm1kjsw+K5g+WwmZCbgPzxLvKImB987f13Kjzz F6EYNklFiubnXJ17dEseIs20pP+23y+OaZgc6MSDh1S0XToXkkU25+ZTXITq11RuF1DX HMY0aTo8YVQGzSkrF4NoYnhQWPYGmN3d5ddRi5cS1cCz3EE6AVcV7abI4+Bj6M+FmyA8 vskg== 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 Return-Path: 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.27.14; Sat, 29 Oct 2022 10:27:26 -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 Content-Transfer-Encoding: 8bit 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 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; } -- 2.30.2