From patchwork Tue Feb 7 19:23:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 54052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp3035400wrn; Tue, 7 Feb 2023 11:29:30 -0800 (PST) X-Google-Smtp-Source: AK7set8oMJoQe71U7ZKV2aG+RahSvYoezLTPUT9F2e4F0SqGkhyFlFtdIKvCNxPTPD0Ku/t+BsGJ X-Received: by 2002:a17:906:eb5b:b0:8aa:502c:44d1 with SMTP id mc27-20020a170906eb5b00b008aa502c44d1mr153936ejb.23.1675798169915; Tue, 07 Feb 2023 11:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675798169; cv=none; d=google.com; s=arc-20160816; b=JKH/tpZDdLZNVFIKldkWP1M4TwNHup17+hER+SeehNRMbhp2RC1FDGebVQxH1A8L1L OxZI9hC6k3Qrdzemd5zY2eyunCWHyFPuv/lup0il4vo72Cb7F9073WTgLIsN1rJMSESo j979tV+ZmjpMviJahgJJ0MHgytXBu4SwZHbceqcKpeaTUg5noFjfwS4ssGUf78IRb1F8 uOZneOA7FhQhjHIYW12qI0myUbi87tptbzPzp4ND4OHf9E6P43uu/TDKxDB2h3HqvR/j mjdMn3MlbrhCPlql3pbGNP2wuVeJBs6iq7pG3o7VXElEME4+/V2ZNUKsJchlTXBPl3M+ ZrKg== 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=tWS7QdpaOzoGjZNdHnbcJ2Pa2Y/tyPn8eKx78QVdhpk=; b=T9IWUN1PO50ImEK/DnUSEdV8IsPbwxP9ue9p36qqVwAgr6EXAmzvFJ/QEQthv9cN/H q2kzvFSB81BperFbG/0d/OysbajGo+q+4RolJppSHIOyM0PrB73aFOCHAW9hvVwMtHbm Fv46xkVoZxWKz66qPbU6ByFnSPw3MK7OdzWmL9nN3ZTiBnAoy9RbktRG9mrsaaB/mySW SZ3b9s5gGJPXmJaQ5xa0YD3Li3Uvp+Dec81mHrSBBjvkf5Jq13DU5h4ucSBYePYYw9xm J3nXumwij7yALKM6Iue29OCzd6nVlpZiTNt4dHjmH5PtPeQ5oflNwN75TXssezi/jtFA hinQ== 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 10-20020a170906028a00b0088bf3542ea4si21523008ejf.992.2023.02.07.11.29.07; Tue, 07 Feb 2023 11:29:29 -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 S231178AbjBGTYB (ORCPT + 99 others); Tue, 7 Feb 2023 14:24:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbjBGTXv (ORCPT ); Tue, 7 Feb 2023 14:23:51 -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 1EC633B658 for ; Tue, 7 Feb 2023 11:23:45 -0800 (PST) Received: from dslb-178-004-202-208.178.004.pools.vodafone-ip.de ([178.4.202.208] 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 1pPTZ5-0002XK-Oc; Tue, 07 Feb 2023 20:23:39 +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 6/7] staging: r8188eu: simplify rtw_get_ff_hwaddr Date: Tue, 7 Feb 2023 20:23:18 +0100 Message-Id: <20230207192319.294203-7-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230207192319.294203-1-martin@kaiser.cx> References: <20230207192319.294203-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?1757201741680986642?= X-GMAIL-MSGID: =?utf-8?q?1757201741680986642?= On both occassions where rtw_get_ff_hwaddr is called, the result is used as addr parameter for rtw_write_port. rtw_write_port only needs the info if the high queue was used or not. Simplify rtw_get_ff_hwaddr accordingly and remove the now unused queue defines. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_xmit.c | 32 +--------------------- drivers/staging/r8188eu/include/rtw_xmit.h | 7 ----- 2 files changed, 1 insertion(+), 38 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_xmit.c b/drivers/staging/r8188eu/core/rtw_xmit.c index df88b3e29e77..d0761ac2e695 100644 --- a/drivers/staging/r8188eu/core/rtw_xmit.c +++ b/drivers/staging/r8188eu/core/rtw_xmit.c @@ -1568,39 +1568,9 @@ static int rtw_br_client_tx(struct adapter *padapter, struct sk_buff **pskb) u32 rtw_get_ff_hwaddr(struct xmit_frame *pxmitframe) { - u32 addr; struct pkt_attrib *pattrib = &pxmitframe->attrib; - switch (pattrib->qsel) { - case 0: - case 3: - addr = BE_QUEUE_INX; - break; - case 1: - case 2: - addr = BK_QUEUE_INX; - break; - case 4: - case 5: - addr = VI_QUEUE_INX; - break; - case 6: - case 7: - addr = VO_QUEUE_INX; - break; - case 0x10: - addr = BCN_QUEUE_INX; - break; - case 0x11:/* BC/MC in PS (HIQ) */ - addr = HIGH_QUEUE_INX; - break; - case 0x12: - default: - addr = MGT_QUEUE_INX; - break; - } - - return addr; + return pattrib->qsel == 0x11 ? HIGH_QUEUE_INX : 0; } /* diff --git a/drivers/staging/r8188eu/include/rtw_xmit.h b/drivers/staging/r8188eu/include/rtw_xmit.h index feeac85aedb0..e4e5af198eee 100644 --- a/drivers/staging/r8188eu/include/rtw_xmit.h +++ b/drivers/staging/r8188eu/include/rtw_xmit.h @@ -26,14 +26,7 @@ #define XMIT_BE_QUEUE (2) #define XMIT_BK_QUEUE (3) -#define VO_QUEUE_INX 0 -#define VI_QUEUE_INX 1 -#define BE_QUEUE_INX 2 -#define BK_QUEUE_INX 3 -#define BCN_QUEUE_INX 4 -#define MGT_QUEUE_INX 5 #define HIGH_QUEUE_INX 6 -#define TXCMD_QUEUE_INX 7 #define HW_QUEUE_ENTRY 8