Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1743964imw; Sat, 9 Jul 2022 10:37:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vPFgKm5HbYQ/yoj7OUmWV2NZ1YuCk4+r4AYdO/BgiV2GzKkMNyKfdmONQHibpYZm6gqv9t X-Received: by 2002:a05:6402:13:b0:439:ffe8:bec9 with SMTP id d19-20020a056402001300b00439ffe8bec9mr13227312edu.297.1657388221457; Sat, 09 Jul 2022 10:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657388221; cv=none; d=google.com; s=arc-20160816; b=L8Y6kNQn9qz08Z1A9/J+dGJyb9TnuN6Dl1bpQilaMpCBsB/AaWAgtEh8QwMNY7L9on AeQafnoqY+3lQ978NilepyxRicJzVSvWftAJDAIzSpZzsPYp7ITEmMjyKlK0i37mpbfu TAnR4YcQ5Hw68D+tmPWVLeqLg5fKKY6d1PqTzjdZCxitSqCP50dFdV7c3rwIbyR9NZKH 0wFyQ0ufibAke1MXu2Ml70FzZ0bA0FMSD1+coVb+liZQiK78RcJernetzo+qcHKVUEuQ UFBCe/VtWLFUUTQ8f8ZaxHn6kTQj5J3Ofj2T/gXr7LdNngUIk0lTTsVt9UIbKvPYli+D JJUw== 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=GRu5epUtjUdUPuuVyJxJs8CfDL1DPM6QWAqNYK8uUpw=; b=CS2TAy63+5N2PkO2dwE751NRgfAYBmHtyfPdPzDH+0653a9tPRwLHSkS74YPTscWMN hbt+yqBvA382fSsdFIah5tA4TZ/D//m3cWkD4QAcfphAvu7yn0Zi3D0rClx6ETKBbMIv DhY/ZoBoD2CulSmi4vwYb/B4LFgNEZ9CVmWLCaAOI6rDh5IK1ukEPPQAKKqZ3giXzzn7 vC8lA6++mObcxez/n5yZxS6UuyOROA2tTdV9GI+MLu6NAVyC1SXxZ7CIO4ys1lXJrRl4 mMMwy1Tk0CbzTIAwPF9qxsXxkRx+tePJb9sqOz3aGlmVA3eOFzrxK5HJHJOuUgzEy6sw OJ6A== 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 nb36-20020a1709071ca400b006fed9affed0si115352ejc.528.2022.07.09.10.36.35; Sat, 09 Jul 2022 10:37:01 -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 S229540AbiGIRKp (ORCPT + 99 others); Sat, 9 Jul 2022 13:10:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiGIRK1 (ORCPT ); Sat, 9 Jul 2022 13:10:27 -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 DBB5412093 for ; Sat, 9 Jul 2022 10:10:25 -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 1oADyI-0005n0-6i; Sat, 09 Jul 2022 19:10:22 +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 12/14] staging: r8188eu: _offset is always 0 in efuse_phymap_to_logical Date: Sat, 9 Jul 2022 19:09:58 +0200 Message-Id: <20220709171000.180481-13-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 _offset parameter of iol_read_efuse is always 0. Remove the parameter and use 0 in the function body. We can now replace the bytewise copy from efuseTbl to pbuf with memcpy. Signed-off-by: Martin Kaiser --- drivers/staging/r8188eu/hal/rtl8188e_hal_init.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c index f552b9adece3..87ebfb013193 100644 --- a/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c +++ b/drivers/staging/r8188eu/hal/rtl8188e_hal_init.c @@ -83,7 +83,7 @@ static s32 iol_InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy) } static void -efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) +efuse_phymap_to_logical(u8 *phymap, u16 _size_byte, u8 *pbuf) { u8 *efuseTbl = NULL; u8 rtemp8; @@ -188,8 +188,7 @@ efuse_phymap_to_logical(u8 *phymap, u16 _offset, u16 _size_byte, u8 *pbuf) /* */ /* 4. Copy from Efuse map to output pointer memory!!! */ /* */ - for (i = 0; i < _size_byte; i++) - pbuf[i] = efuseTbl[_offset + i]; + memcpy(pbuf, efuseTbl, _size_byte); /* */ /* 5. Calculate Efuse utilization. */ @@ -311,7 +310,7 @@ static s32 iol_read_efuse(struct adapter *padapter, u16 size_byte, u8 *logical_m status = iol_execute(padapter, CMD_READ_EFUSE_MAP); if (status == _SUCCESS) efuse_read_phymap_from_txpktbuf(padapter, 0, physical_map, &size); - efuse_phymap_to_logical(physical_map, 0, size_byte, logical_map); + efuse_phymap_to_logical(physical_map, size_byte, logical_map); return status; } -- 2.30.2