From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02F8EC433F5 for ; Sat, 13 Nov 2021 18:56:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DBA79611CE for ; Sat, 13 Nov 2021 18:56:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236064AbhKMS67 (ORCPT ); Sat, 13 Nov 2021 13:58:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236112AbhKMS6u (ORCPT ); Sat, 13 Nov 2021 13:58:50 -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 98C6BC061206 for ; Sat, 13 Nov 2021 10:55:55 -0800 (PST) Received: from dslb-188-096-147-224.188.096.pools.vodafone-ip.de ([188.96.147.224] 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 1mlyBr-0002H8-U6; Sat, 13 Nov 2021 19:55:51 +0100 From: Martin Kaiser To: Greg Kroah-Hartman Cc: Larry Finger , Phillip Potter , Michael Straube , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 07/15] staging: r8188eu: merge Efuse_ReadAllMap into EFUSE_ShadowMapUpdate Date: Sat, 13 Nov 2021 19:55:10 +0100 Message-Id: <20211113185518.23941-8-martin@kaiser.cx> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211113185518.23941-1-martin@kaiser.cx> References: <20211113185518.23941-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Efuse_ReadAllMap is small, it's called only by EFUSE_ShadowMapUpdate. This patch merges the two functions. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/core/rtw_efuse.c | 42 +++++------------------- 1 file changed, 9 insertions(+), 33 deletions(-) diff --git a/drivers/staging/r8188eu/core/rtw_efuse.c b/drivers/staging/r8188eu/core/rtw_efuse.c index d799d0c7817f..2999313dfe69 100644 --- a/drivers/staging/r8188eu/core/rtw_efuse.c +++ b/drivers/staging/r8188eu/core/rtw_efuse.c @@ -215,35 +215,6 @@ void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata) } } -/*----------------------------------------------------------------------------- - * Function: Efuse_ReadAllMap - * - * Overview: Read All Efuse content - * - * Input: NONE - * - * Output: NONE - * - * Return: NONE - * - * Revised History: - * When Who Remark - * 11/11/2008 MHC Create Version 0. - * - *---------------------------------------------------------------------------*/ -static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 *Efuse) -{ - u16 mapLen = 0; - - rtl8188e_EfusePowerSwitch(pAdapter, true); - - rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, TYPE_EFUSE_MAP_LEN, (void *)&mapLen); - - rtl8188e_ReadEFuse(pAdapter, 0, mapLen, Efuse); - - rtl8188e_EfusePowerSwitch(pAdapter, false); -} - /*----------------------------------------------------------------------------- * Function: EFUSE_ShadowMapUpdate * @@ -267,8 +238,13 @@ void EFUSE_ShadowMapUpdate(struct adapter *pAdapter) rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, TYPE_EFUSE_MAP_LEN, (void *)&mapLen); - if (pEEPROM->bautoload_fail_flag) + if (pEEPROM->bautoload_fail_flag) { memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen); - else - Efuse_ReadAllMap(pAdapter, pEEPROM->efuse_eeprom_data); -} /* EFUSE_ShadowMapUpdate */ + return; + } + + rtl8188e_EfusePowerSwitch(pAdapter, true); + rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, TYPE_EFUSE_MAP_LEN, (void *)&mapLen); + rtl8188e_ReadEFuse(pAdapter, 0, mapLen, pEEPROM->efuse_eeprom_data); + rtl8188e_EfusePowerSwitch(pAdapter, false); +} -- 2.20.1