Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1739325imw; Sat, 9 Jul 2022 10:30:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+nVUKyGIwaaiYRt1QDXiTQiAHR7zgS7oSA4D0JlJ++KAScEtCOabme3YDEPg7FPFqC8Zx X-Received: by 2002:a17:907:9619:b0:72b:4761:be19 with SMTP id gb25-20020a170907961900b0072b4761be19mr221211ejc.20.1657387855896; Sat, 09 Jul 2022 10:30:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657387855; cv=none; d=google.com; s=arc-20160816; b=zimwUcVeZ9J1oLWeSVcqQtm1/e0GBCF3NfM4Vs92XxQM4ZpeSyJxD6rGbCBxSJWFvM viC66EVGNv7bqGUmt61b8CyewthZ+WRltkpzQM3UlBvxF40jNX5tFZGfXL46QCrqCQSM F7GN1hMZIs686pTqEf6IggpFooVle5aPba/6VsFhHXsyWFydy2o7rLNNUBIWHyEJtyxH 5khATf+TqNaJ0NYpLhJBOoi2RMy390DtEHA/t756rU+Qji8mD/ZkNgG97Fh4oVdCZqxZ 39IZXd3m1w0pon74BLMCrsP2fZ5r/nPPXrSl1fjyZQdWpADeZwkaRWq7WFQ9YJ0ZdXUN hB3w== 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=Rfy6Q3WJK27QANu4WqvCnQsVmUL6zyzBX73dNxo9bVM=; b=SQOCfLtuAgCvm88wzM/X197XlvWVTpd3Xz30Ha2fqVA0I1a3bJyD9POAVsaV/rrEQH /LqnWpJugZuc++1WeX+4vr8/HGbPcHTlvIbgJBWo49YaDkTaXpMK9vpxgkyxPdj9l7rU SRWO8u8eLB9e1CFYA72Tx/+GTMxEGIt6+iEWMhXp2feeLn/2H0NZU4DJSpGMVsptCIDy iPDc55dHQNicTMB4lZ2O7yKvhF5w5iIrxjBBzRSPzQFWxtekNKsZ9ZbsOel9IPevHM7T hEAB5E2/A4JoGMJrqr9nSJHyOn37kRxxObc5YQ9ZEIyWwmiqVwAeRYJDSSVTfGaFBZNu 6qcQ== 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 jg4-20020a170907970400b0072a47b13d67si1384646ejc.582.2022.07.09.10.30.31; Sat, 09 Jul 2022 10:30:55 -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 S229733AbiGIRK7 (ORCPT + 99 others); Sat, 9 Jul 2022 13:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiGIRK3 (ORCPT ); Sat, 9 Jul 2022 13:10:29 -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 62CF312749 for ; Sat, 9 Jul 2022 10:10:28 -0700 (PDT) Received: from dslb-188-096-144-007.188.096.pools.vodafone-ip.de ([188.96.144.7] 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 1oADyJ-0005n0-SW; Sat, 09 Jul 2022 19:10:23 +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 14/14] staging: r8188eu: the bcnhead parameter is always 0 Date: Sat, 9 Jul 2022 19:10:00 +0200 Message-Id: <20220709171000.180481-15-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220709171000.180481-1-martin@kaiser.cx> References: <20220709171000.180481-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,T_SCC_BODY_TEXT_LINE 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 The only caller of efuse_read_phymap_from_txpktbuf sets bcnhead to 0. Remove this function parameter and simplify the function body. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c index ddda3f994fa7..fe477438899e 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c @@ -193,13 +193,11 @@ efuse_phymap_to_logical(u8 *phymap, u16 _size_byte, u8 *pbuf) /* FIXME: add error handling in callers */ static int efuse_read_phymap_from_txpktbuf( struct adapter *adapter, - int bcnhead, /* beacon head, where FW store len(2-byte) and efuse physical map. */ u8 *content, /* buffer to store efuse physical map */ u16 *size /* for efuse content: the max byte to read. will update to byte read */ ) { unsigned long timeout; - u16 dbg_addr = 0; __le32 lo32 = 0, hi32 = 0; u16 len = 0, count = 0; int i = 0, res; @@ -208,20 +206,10 @@ static int efuse_read_phymap_from_txpktbuf( u8 *pos = content; u32 reg32; - if (bcnhead < 0) { /* if not valid */ - res = rtw_read8(adapter, REG_TDECTRL + 1, ®); - if (res) - return res; - - bcnhead = reg; - } - rtw_write8(adapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); - dbg_addr = bcnhead * 128 / 8; /* 8-bytes addressing */ - while (1) { - rtw_write16(adapter, REG_PKTBUF_DBG_ADDR, dbg_addr + i); + rtw_write16(adapter, REG_PKTBUF_DBG_ADDR, i); rtw_write8(adapter, REG_TXPKTBUF_DBG, 0); timeout = jiffies + msecs_to_jiffies(1000); @@ -300,7 +288,7 @@ static s32 iol_read_efuse(struct adapter *padapter, u16 size_byte, u8 *logical_m rtw_write8(padapter, REG_PKT_BUFF_ACCESS_CTRL, TXPKT_BUF_SELECT); status = iol_execute(padapter, CMD_READ_EFUSE_MAP); if (status == _SUCCESS) - efuse_read_phymap_from_txpktbuf(padapter, 0, physical_map, &size); + efuse_read_phymap_from_txpktbuf(padapter, physical_map, &size); efuse_phymap_to_logical(physical_map, size_byte, logical_map); return status; } -- 2.30.2