Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1d46529 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman
Browse files

staging: ath6kl: Convert (status != A_OK) to (status)



Just use the status variable as a test not a comparison.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f68057e6
Loading
Loading
Loading
Loading
+26 −26
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ BMIDone(HIF_DEVICE *device)
    cid = BMI_DONE;

    status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }
@@ -156,14 +156,14 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
    cid = BMI_GET_TARGET_INFO;

    status = bmiBufferSend(device, (A_UCHAR *)&cid, sizeof(cid));
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }

    status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_ver,
                                                sizeof(targ_info->target_ver), true);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Version from the device\n"));
        return A_ERROR;
    }
@@ -172,7 +172,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
        /* Determine how many bytes are in the Target's targ_info */
        status = bmiBufferReceive(device, (A_UCHAR *)&targ_info->target_info_byte_count,
                                            sizeof(targ_info->target_info_byte_count), true);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info Byte Count from the device\n"));
            return A_ERROR;
        }
@@ -187,7 +187,7 @@ BMIGetTargetInfo(HIF_DEVICE *device, struct bmi_target_info *targ_info)
        status = bmiBufferReceive(device,
                        ((A_UCHAR *)targ_info)+sizeof(targ_info->target_info_byte_count),
                        sizeof(*targ_info)-sizeof(targ_info->target_info_byte_count), true);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read Target Info (%d bytes) from the device\n",
                        					targ_info->target_info_byte_count));
            return A_ERROR;
@@ -239,12 +239,12 @@ BMIReadMemory(HIF_DEVICE *device,
        offset += sizeof(length);

        status = bmiBufferSend(device, pBMICmdBuf, offset);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
            return A_ERROR;
        }
        status = bmiBufferReceive(device, pBMICmdBuf, rxlen, true);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
            return A_ERROR;
        }
@@ -309,7 +309,7 @@ BMIWriteMemory(HIF_DEVICE *device,
        A_MEMCPY(&(pBMICmdBuf[offset]), src, txlen);
        offset += txlen;
        status = bmiBufferSend(device, pBMICmdBuf, offset);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
            return A_ERROR;
        }
@@ -352,13 +352,13 @@ BMIExecute(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), param, sizeof(*param));
    offset += sizeof(*param);
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }

    status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), false);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
        return A_ERROR;
    }
@@ -397,7 +397,7 @@ BMISetAppStart(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address));
    offset += sizeof(address);
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }
@@ -436,13 +436,13 @@ BMIReadSOCRegister(HIF_DEVICE *device,
    offset += sizeof(address);

    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }

    status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*param), true);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
        return A_ERROR;
    }
@@ -483,7 +483,7 @@ BMIWriteSOCRegister(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), &param, sizeof(param));
    offset += sizeof(param);
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }
@@ -532,13 +532,13 @@ BMIrompatchInstall(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), &do_activate, sizeof(do_activate));
    offset += sizeof(do_activate);
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }

    status = bmiBufferReceive(device, pBMICmdBuf, sizeof(*rompatch_id), true);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read from the device\n"));
        return A_ERROR;
    }
@@ -576,7 +576,7 @@ BMIrompatchUninstall(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), &rompatch_id, sizeof(rompatch_id));
    offset += sizeof(rompatch_id);
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }
@@ -619,7 +619,7 @@ _BMIrompatchChangeActivation(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), rompatch_list, length);
    offset += length;
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
        return A_ERROR;
    }
@@ -683,7 +683,7 @@ BMILZData(HIF_DEVICE *device,
        A_MEMCPY(&(pBMICmdBuf[offset]), &buffer[length - remaining], txlen);
        offset += txlen;
        status = bmiBufferSend(device, pBMICmdBuf, offset);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to write to the device\n"));
            return A_ERROR;
        }
@@ -722,7 +722,7 @@ BMILZStreamStart(HIF_DEVICE *device,
    A_MEMCPY(&(pBMICmdBuf[offset]), &address, sizeof(address));
    offset += sizeof(address);
    status = bmiBufferSend(device, pBMICmdBuf, offset);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to Start LZ Stream to the device\n"));
        return A_ERROR;
    }
@@ -757,7 +757,7 @@ bmiBufferSend(HIF_DEVICE *device,
         * make all HIF accesses 4-byte aligned */
        status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, 4,
            HIF_RD_SYNC_BYTE_INC, NULL);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to decrement the command credit count register\n"));
            return A_ERROR;
        }
@@ -769,7 +769,7 @@ bmiBufferSend(HIF_DEVICE *device,
        address = mboxAddress[ENDPOINT1];
        status = HIFReadWrite(device, address, buffer, length,
            HIF_WR_SYNC_BYTE_INC, NULL);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to send the BMI data to the device\n"));
            return A_ERROR;
        }
@@ -868,7 +868,7 @@ bmiBufferReceive(HIF_DEVICE *device,
                status = getPendingEventsFunc(device,
                                              &hifPendingEvents,
                                              NULL);
                if (status != A_OK) {
                if (status) {
                    AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BMI: Failed to get pending events \n"));
                    break;
                }
@@ -881,7 +881,7 @@ bmiBufferReceive(HIF_DEVICE *device,
            
            status = HIFReadWrite(device, RX_LOOKAHEAD_VALID_ADDRESS, (u8 *)&word_available,
                sizeof(word_available), HIF_RD_SYNC_BYTE_INC, NULL);
            if (status != A_OK) {
            if (status) {
                AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read RX_LOOKAHEAD_VALID register\n"));
                return A_ERROR;
            }
@@ -932,7 +932,7 @@ bmiBufferReceive(HIF_DEVICE *device,
             * The rationale here is to make all HIF accesses a multiple of 4 bytes */
            status = HIFReadWrite(device, address, (u8 *)pBMICmdCredits, sizeof(*pBMICmdCredits),
                HIF_RD_SYNC_BYTE_FIX, NULL);
            if (status != A_OK) {
            if (status) {
                AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the command credit count register\n"));
                return A_ERROR;
            }
@@ -949,7 +949,7 @@ bmiBufferReceive(HIF_DEVICE *device,

    address = mboxAddress[ENDPOINT1];
    status = HIFReadWrite(device, address, buffer, length, HIF_RD_SYNC_BYTE_INC, NULL);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Unable to read the BMI data from the device\n"));
        return A_ERROR;
    }
+1 −1
Original line number Diff line number Diff line
@@ -1088,7 +1088,7 @@ static int hifDeviceSuspend(struct device *dev)
    if (device && device->claimedContext && osdrvCallbacks.deviceSuspendHandler) {
        device->is_suspend = true; /* set true first for PowerStateChangeNotify(..) */
        status = osdrvCallbacks.deviceSuspendHandler(device->claimedContext);
        if (status != A_OK) {
        if (status) {
            device->is_suspend = false;
        }
    }
+18 −18
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ int DevSetup(AR6K_DEVICE *pDev)
        status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR,
                                    &pDev->MailBoxInfo, sizeof(pDev->MailBoxInfo));

        if (status != A_OK) {
        if (status) {
            A_ASSERT(false);
            break;
        }
@@ -127,7 +127,7 @@ int DevSetup(AR6K_DEVICE *pDev)
        status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
                                    blocksizes, sizeof(blocksizes));

        if (status != A_OK) {
        if (status) {
            A_ASSERT(false);
            break;
        }
@@ -266,7 +266,7 @@ int DevEnableInterrupts(AR6K_DEVICE *pDev)
                          HIF_WR_SYNC_BYTE_INC,
                          NULL);

    if (status != A_OK) {
    if (status) {
        /* Can't write it for some reason */
        AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
                        ("Failed to update interrupt control registers err: %d\n", status));
@@ -1156,7 +1156,7 @@ static int SendBuffers(AR6K_DEVICE *pDev, int mbox)
                              paddedLength,
                              request,
                              NULL);
        if (status != A_OK) {
        if (status) {
            break;
        }
        totalBytes += sendList[i].length;
@@ -1182,7 +1182,7 @@ static int GetCredits(AR6K_DEVICE *pDev, int mbox, int *pCredits)
        address = COUNT_DEC_ADDRESS + (AR6K_MAILBOXES + mbox) * 4;
        status = HIFReadWrite(pDev->HIFDevice, address, &credits, sizeof(credits),
                              HIF_RD_SYNC_BYTE_FIX, NULL);
        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
                ("Unable to decrement the command credit count register (mbox=%d)\n",mbox));
            status = A_ERROR;
@@ -1244,7 +1244,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox)
             * until we get at least 1 credit or it times out */
        status = GetCredits(pDev, mbox, &credits);

        if (status != A_OK) {
        if (status) {
            break;
        }

@@ -1264,7 +1264,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox)
                                  paddedLength,
                                  request,
                                  NULL);
            if (status != A_OK) {
            if (status) {
                AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to read %d bytes on mailbox:%d : address:0x%X \n",
                        recvList[curBuffer].length, mbox, g_MailboxAddrs[mbox]));
                break;
@@ -1275,7 +1275,7 @@ static int RecvBuffers(AR6K_DEVICE *pDev, int mbox)
            curBuffer++;
        }

        if (status != A_OK) {
        if (status) {
            break;
        }
            /* go back and get some more */
@@ -1302,7 +1302,7 @@ static int DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox)
            /* send out buffers */
        status = SendBuffers(pDev,mbox);

        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Sending buffers Failed : %d mbox:%d\n",status,mbox));
            break;
        }
@@ -1310,7 +1310,7 @@ static int DoOneMboxHWTest(AR6K_DEVICE *pDev, int mbox)
            /* go get them, this will block */
        status =  RecvBuffers(pDev, mbox);

        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Recv buffers Failed : %d mbox:%d\n",status,mbox));
            break;
        }
@@ -1348,7 +1348,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
        status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_ADDR,
                                    g_MailboxAddrs, sizeof(g_MailboxAddrs));

        if (status != A_OK) {
        if (status) {
            A_ASSERT(false);
            break;
        }
@@ -1357,7 +1357,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
        status = HIFConfigureDevice(pDev->HIFDevice, HIF_DEVICE_GET_MBOX_BLOCK_SIZE,
                                    g_BlockSizes, sizeof(g_BlockSizes));

        if (status != A_OK) {
        if (status) {
            A_ASSERT(false);
            break;
        }
@@ -1380,7 +1380,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
             * mailbox 0 */
        status = GetCredits(pDev, 0, &credits);

        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait for target ready \n"));
            break;
        }
@@ -1395,7 +1395,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
                              HIF_RD_SYNC_BYTE_INC,
                              NULL);

        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to wait get parameters \n"));
            break;
        }
@@ -1423,7 +1423,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
                              HIF_WR_SYNC_BYTE_INC,
                              NULL);

        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write end marker \n"));
            break;
        }
@@ -1440,7 +1440,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
                              HIF_WR_SYNC_BYTE_INC,
                              NULL);

        if (status != A_OK) {
        if (status) {
            AR_DEBUG_PRINTF(ATH_DEBUG_ERR, ("Failed to write block mask \n"));
            break;
        }
@@ -1450,7 +1450,7 @@ int DoMboxHWTest(AR6K_DEVICE *pDev)
            /* execute the test on each mailbox */
        for (i = 0; i < AR6K_MAILBOXES; i++) {
            status = DoOneMboxHWTest(pDev, i);
            if (status != A_OK) {
            if (status) {
                break;
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -240,7 +240,7 @@ int HTCWaitTarget(HTC_HANDLE HTCHandle)

        status = DoMboxHWTest(&target->Device);

        if (status != A_OK) {
        if (status) {
            break;
        }

+11 −11
Original line number Diff line number Diff line
@@ -107,12 +107,12 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
                              4,
                              HIF_WR_SYNC_BYTE_FIX,
                              NULL);
        if (status != A_OK) {
        if (status) {
            break;
        }
    }

    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n",
            Address, RegisterAddr));
        return status;
@@ -128,7 +128,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
                          HIF_WR_SYNC_BYTE_INC,
                          NULL);

    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n",
            Address, RegisterAddr));
        return status;
@@ -157,7 +157,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
                          HIF_WR_SYNC_BYTE_INC,
                          NULL);

    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write initial bytes of 0x%x to window reg: 0x%X \n",
             RegisterAddr, Address));
        return status;
@@ -171,7 +171,7 @@ int ar6000_SetAddressWindowRegister(HIF_DEVICE *hifDevice, u32 RegisterAddr, u32
                          HIF_WR_SYNC_BYTE_INC,
                          NULL);

    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to window reg: 0x%X \n",
            RegisterAddr, Address));
        return status;
@@ -196,7 +196,7 @@ ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
                                             WINDOW_READ_ADDR_ADDRESS,
                                             *address);

    if (status != A_OK) {
    if (status) {
        return status;
    }

@@ -207,7 +207,7 @@ ar6000_ReadRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
                          sizeof(u32),
                          HIF_RD_SYNC_BYTE_INC,
                          NULL);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from WINDOW_DATA_ADDRESS\n"));
        return status;
    }
@@ -232,7 +232,7 @@ ar6000_WriteRegDiag(HIF_DEVICE *hifDevice, u32 *address, u32 *data)
                          sizeof(u32),
                          HIF_WR_SYNC_BYTE_INC,
                          NULL);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write 0x%x to WINDOW_DATA_ADDRESS\n", *data));
        return status;
    }
@@ -294,7 +294,7 @@ ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval)
                          HIF_WR_SYNC_BYTE_FIX,
                          NULL);

    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot write CPU_DBG_SEL (%d)\n", regsel));
        return status;
    }
@@ -305,7 +305,7 @@ ar6k_ReadTargetRegister(HIF_DEVICE *hifDevice, int regsel, u32 *regval)
                          sizeof(vals),
                          HIF_RD_SYNC_BYTE_INC,
                          NULL);
    if (status != A_OK) {
    if (status) {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot read from CPU_DBG_ADDRESS\n"));
        return status;
    }
@@ -335,7 +335,7 @@ _do_write_diag(HIF_DEVICE *hifDevice, u32 addr, u32 value)
    int status;

    status = ar6000_WriteRegDiag(hifDevice, &addr, &value);
    if (status != A_OK)
    if (status)
    {
        AR_DEBUG_PRINTF(ATH_LOG_ERR, ("Cannot force Target to execute ROM!\n"));
    }
Loading