Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp2080262rwj; Sun, 30 Oct 2022 10:54:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fP1lJKdeWnBhm2fBBhlDNJRXqsWS6IK+W66fZBpC109K/8bV6morf8VcpgY7/gUIxRweU X-Received: by 2002:a05:6a00:1a04:b0:52a:d4dc:5653 with SMTP id g4-20020a056a001a0400b0052ad4dc5653mr10431252pfv.69.1667152484526; Sun, 30 Oct 2022 10:54:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667152484; cv=none; d=google.com; s=arc-20160816; b=Cbxmu5gL0FePMh8fpxs/qdAIXnDyzKIFZXTYqURqmJW5B/DaqDLmFR3lvgXX9bJV/H 026aJTGFXOkVlVZt6fq11VEkCAgk+30KgOqp0a1Sdjwn4UsMRJX3wEju40hax8DuoAtq Zv4p6NcpOpCEkRN5HiA1aeOdQdseoijFX+daZo4WtJ0Had5uPae3RnJSajbZcrTeF0fq r03zmnUkoeb+azI6EkfDrwfZTkQEXhEJDR7f6YgFlEa74yTZNdhdTtiu75i3O3IlvrUP AqOLDarkYX4sf9CR0u8ckwHI8TVMT+WBc2vIv7C+aDkyQduq8vS1sOTQ7B2qDAzTW8xl y1sQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b1-20020a631b41000000b0046004666d82si5941504pgm.497.2022.10.30.10.54.33; Sun, 30 Oct 2022 10:54:44 -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 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