]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
staging: rtl8723bs: Remove #if 1 in function hal_EfusePartialWriteCheck
authorPhilipp Hortmann <philipp.g.hortmann@gmail.com>
Sun, 3 Nov 2024 08:14:23 +0000 (09:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Nov 2024 23:55:49 +0000 (00:55 +0100)
Remove #if 1 in function hal_EfusePartialWriteCheck to shorten code.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Link: https://lore.kernel.org/r/2eea90fbdc2ef0ef5c8a224330558ccdefdfdf5b.1730619982.git.philipp.g.hortmann@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c

index be4cc8fc56968bec21ecd87a23e4b204c25f4972..2659999404a3f0b6dd69562250d9932b851c0b80 100644 (file)
@@ -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;