From patchwork Fri Dec 30 18:06:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 37739 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3008537wrt; Fri, 30 Dec 2022 10:08:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXtxrzUVF5qjPHgVt86zQfKPXFz/PCxLOdGoK7lUrZT1OgwIU1dWvoCkijMx2SfTu5bIt8za X-Received: by 2002:a05:6a21:2d09:b0:a4:aa40:2253 with SMTP id tw9-20020a056a212d0900b000a4aa402253mr39743022pzb.21.1672423716285; Fri, 30 Dec 2022 10:08:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672423716; cv=none; d=google.com; s=arc-20160816; b=rKNL0v8FL7qg8i9E3qvf7U9Aa33IBYyG9bk7JhMaJJHN74EQ2bB5GcPLlzueDxBw6E J7610uZv36JHqq7aB9yYDVpG37nhB5FvoLtjiwASdQgrcEjCOW/eWV+81pgp90DPAMj2 Z/NgBULk91uVnv+4wvZ3amXJE/wW0q6+zV/cmxnPsfbq3VJf3K4ZbmFQEj8ZBIxAY5kV 56t9yOwA5d/EbIZLwfCYebt6CRIRWo+G77XT4EwCnVaG+a8deERYuMJ+1Q4zFHvI2psX SKQQGfNAa4IBYUjp0WIGmzfma8SXsPX0vM+QgOTSRhRf8njrfVQih/N+Br4LPCjpEtvV F1pw== 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=gQhMRzDz0mQDPTcmXOeWrfR0LXflPQ4hCNzPpqE7dc0=; b=e7osnYGpT+jyN1fVrNc19Ifc6+DiZNDpUsg1K+YdEV11+S/mi6TfsVRRvAixr+ascE F9wbS3K3aJfXDlTPbXSQqaxGJ4fSqKJWIWzWmYIJTzEuoaUmf6M6k2XZTtSLrMihJhGq vAUNEPA0RtHPbTTpZE/bUcJP+aE9yC+VLnRwHL30L7c4S8dnd0TgvN60CjEVDdL4uE+w 2V8YJf4m+IuvPiBdLNWvGzDdsyRg02Kz3Xtio5OEjCswePbgnFX86XeaURm0omEtEuGo KxWOq1m+1bz2SZCYCfRKYsFFsF6qnbGFlb2CQRPIpmK87cpp6DwWxBQBIAqmRv4+KYdA 4dsw== 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 e2-20020a637442000000b0049f3be3d20bsi3114195pgn.333.2022.12.30.10.08.23; Fri, 30 Dec 2022 10:08:36 -0800 (PST) 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 S235514AbiL3SHt (ORCPT + 99 others); Fri, 30 Dec 2022 13:07:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235412AbiL3SHX (ORCPT ); Fri, 30 Dec 2022 13:07:23 -0500 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 E453B1C435 for ; Fri, 30 Dec 2022 10:07:19 -0800 (PST) Received: from dslb-188-097-208-179.188.097.pools.vodafone-ip.de ([188.97.208.179] 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 1pBJmk-0004rR-Po; Fri, 30 Dec 2022 19:07:14 +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 11/20] staging: r8188eu: clean up qos_option setting Date: Fri, 30 Dec 2022 19:06:37 +0100 Message-Id: <20221230180646.91008-12-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221230180646.91008-1-martin@kaiser.cx> References: <20221230180646.91008-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?1753663370319676439?= X-GMAIL-MSGID: =?utf-8?q?1753663370319676439?= The qos_option variable in function rtw_make_wlanhdr should be a boolean as it's set to true or false. We can directly set it to pqospriv->qos_option instead of using a default value and if statements. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index 6e3b5649b84c..0fef508408a7 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -791,7 +791,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr struct ieee80211_hdr *pwlanhdr = (struct ieee80211_hdr *)hdr; struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct qos_priv *pqospriv = &pmlmepriv->qospriv; - u8 qos_option = false; + bool qos_option; __le16 *fctrl = &pwlanhdr->frame_control; struct sta_info *psta; @@ -817,26 +817,20 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN); - - if (pqospriv->qos_option) - qos_option = true; + qos_option = pqospriv->qos_option; } else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { /* to_ds = 0, fr_ds = 1; */ SetFrDs(fctrl); memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, get_bssid(pmlmepriv), ETH_ALEN); memcpy(pwlanhdr->addr3, pattrib->src, ETH_ALEN); - - if (psta->qos_option) - qos_option = true; + qos_option = psta->qos_option; } else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE)) { memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN); memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN); memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN); - - if (psta->qos_option) - qos_option = true; + qos_option = psta->qos_option; } else { return _FAIL; }