mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Cc: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Subject: [PATCH 02/13] staging: rtl8723bs: Remove #if 1 in function hal_EfusePartialWriteCheck
Date: Sun,  3 Nov 2024 09:14:23 +0100	[thread overview]
Message-ID: <2eea90fbdc2ef0ef5c8a224330558ccdefdfdf5b.1730619982.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1730619982.git.philipp.g.hortmann@gmail.com>

Remove #if 1 in function hal_EfusePartialWriteCheck to shorten code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 53 -------------------
 1 file changed, 53 deletions(-)

diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
index be4cc8fc5696..2659999404a3 100644
--- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
+++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c
@@ -1327,61 +1327,8 @@ static u8 hal_EfusePartialWriteCheck(
 		}
 
 		if (efuse_OneByteRead(padapter, startAddr, &efuse_data, bPseudoTest) && (efuse_data != 0xFF)) {
-#if 1
 			bRet = false;
 			break;
-#else
-			if (EXT_HEADER(efuse_data)) {
-				cur_header = efuse_data;
-				startAddr++;
-				efuse_OneByteRead(padapter, startAddr, &efuse_data, bPseudoTest);
-				if (ALL_WORDS_DISABLED(efuse_data)) {
-					bRet = false;
-					break;
-				} else {
-					curPkt.offset = ((cur_header & 0xE0) >> 5) | ((efuse_data & 0xF0) >> 1);
-					curPkt.word_en = efuse_data & 0x0F;
-				}
-			} else {
-				cur_header  =  efuse_data;
-				curPkt.offset = (cur_header>>4) & 0x0F;
-				curPkt.word_en = cur_header & 0x0F;
-			}
-
-			curPkt.word_cnts = Efuse_CalculateWordCnts(curPkt.word_en);
-			/*  if same header is found but no data followed */
-			/*  write some part of data followed by the header. */
-			if (
-				(curPkt.offset == pTargetPkt->offset) &&
-				(hal_EfuseCheckIfDatafollowed(padapter, curPkt.word_cnts, startAddr+1, bPseudoTest) == false) &&
-				wordEnMatched(pTargetPkt, &curPkt, &matched_wden) == true
-			) {
-				/*  Here to write partial data */
-				badworden = Efuse_WordEnableDataWrite(padapter, startAddr+1, matched_wden, pTargetPkt->data, bPseudoTest);
-				if (badworden != 0x0F) {
-					u32 PgWriteSuccess = 0;
-					/*  if write fail on some words, write these bad words again */
-					if (efuseType == EFUSE_WIFI)
-						PgWriteSuccess = Efuse_PgPacketWrite(padapter, pTargetPkt->offset, badworden, pTargetPkt->data, bPseudoTest);
-					else
-						PgWriteSuccess = Efuse_PgPacketWrite_BT(padapter, pTargetPkt->offset, badworden, pTargetPkt->data, bPseudoTest);
-
-					if (!PgWriteSuccess) {
-						bRet = false;	/*  write fail, return */
-						break;
-					}
-				}
-				/*  partial write ok, update the target packet for later use */
-				for (i = 0; i < 4; i++) {
-					if ((matched_wden & (0x1<<i)) == 0) { /*  this word has been written */
-						pTargetPkt->word_en |= (0x1<<i);	/*  disable the word */
-					}
-				}
-				pTargetPkt->word_cnts = Efuse_CalculateWordCnts(pTargetPkt->word_en);
-			}
-			/*  read from next header */
-			startAddr = startAddr + (curPkt.word_cnts*2) + 1;
-#endif
 		} else {
 			/*  not used header, 0xff */
 			*pAddr = startAddr;
-- 
2.43.0


  parent reply	other threads:[~2024-11-03  8:14 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-03  8:14 [PATCH 00/13] staging: rtl8723bs: Replace function pointers and #if 1 Philipp Hortmann
2024-11-03  8:14 ` [PATCH 01/13] staging: rtl8723bs: Replace function thread_enter Philipp Hortmann
2024-11-03  8:14 ` Philipp Hortmann [this message]
2024-11-03  8:14 ` [PATCH 03/13] staging: rtl8723bs: Remove #if 1 in function hal_EfuseGetCurrentSize_BT Philipp Hortmann
2024-11-03  8:14 ` [PATCH 04/13] staging: rtl8723bs: Remove #if 1 in function ReadChipVersion8723B Philipp Hortmann
2024-11-03  8:14 ` [PATCH 05/13] staging: rtl8723bs: Remove function pointer check_ips_status Philipp Hortmann
2024-11-03  8:14 ` [PATCH 06/13] staging: rtl8723bs: Remove function pointer SetHwRegHandler Philipp Hortmann
2024-11-03  8:14 ` [PATCH 07/13] staging: rtl8723bs: Remove function pointer GetHwRegHandler Philipp Hortmann
2024-11-03  8:14 ` [PATCH 08/13] staging: rtl8723bs: Remove function pointer SetHwRegHandlerWithBuf Philipp Hortmann
2024-11-03  8:14 ` [PATCH 09/13] staging: rtl8723bs: Remove function pointer GetHalDefVarHandler Philipp Hortmann
2024-11-03  8:14 ` [PATCH 10/13] staging: rtl8723bs: Remove function pointer SetHalDefVarHandler Philipp Hortmann
2024-11-03  8:14 ` [PATCH 11/13] staging: rtl8723bs: Remove function pointer hal_xmit Philipp Hortmann
2024-11-03  8:14 ` [PATCH 12/13] staging: rtl8723bs: Remove function pointer mgnt_xmit Philipp Hortmann
2024-11-03  8:14 ` [PATCH 13/13] staging: rtl8723bs: Remove function pointer hal_xmitframe_enqueue Philipp Hortmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2eea90fbdc2ef0ef5c8a224330558ccdefdfdf5b.1730619982.git.philipp.g.hortmann@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome