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

staging: ath6kl: Remove A_SUCCESS macro



Remove obfuscating A_SUCCESS(foo) macro.
Just test for !foo instead.

Reformat a few macros that used A_SUCCESS for better readability.
Add do { foo } while (0) surrounds to those macros too.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatarVipin Mehta <vipin.mehta@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1f4c34bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -985,7 +985,7 @@ BMIFastDownload(HIF_DEVICE *device, A_UINT32 address, A_UCHAR *buffer, A_UINT32
        status = BMILZData(device, (A_UINT8 *)&lastWord, 4);
    }

    if (A_SUCCESS(status)) {
    if (!status) {
        //
        // Close compressed stream and open a new (fake) one.  This serves mainly to flush Target caches.
        //
+2 −2
Original line number Diff line number Diff line
@@ -1120,7 +1120,7 @@ static int hifDeviceResume(struct device *dev)
    }
    AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: -hifDeviceResume\n"));

    return A_SUCCESS(status) ? 0 : status;
    return status;
}
#endif /* CONFIG_PM */

@@ -1167,7 +1167,7 @@ int hifWaitForPendingRecv(HIF_DEVICE *device)
	    status = HIFReadWrite(device, HOST_INT_STATUS_ADDRESS,
				    (A_UINT8 *)&host_int_status, sizeof(host_int_status),
			  	     HIF_RD_SYNC_BYTE_INC, NULL);
	    host_int_status = A_SUCCESS(status) ? (host_int_status & (1 << 0)) : 0;
	    host_int_status = !status ? (host_int_status & (1 << 0)) : 0;
		if (host_int_status) {
	        schedule(); /* schedule for next dsrHandler */
		}
+3 −3
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ int DevWaitForPendingRecv(AR6K_DEVICE *pDev,A_UINT32 TimeoutInMs,A_BOOL *pbIsRec
            break;
        }

        host_int_status = A_SUCCESS(status) ? (host_int_status & (1 << 0)):0;
        host_int_status = !status ? (host_int_status & (1 << 0)):0;
        if(!host_int_status)
        {
            status          = A_OK;
@@ -832,7 +832,7 @@ int DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer)
            /* we can try to use a virtual DMA scatter mechanism using legacy HIFReadWrite() */
        status = DevSetupVirtualScatterSupport(pDev);

        if (A_SUCCESS(status)) {
        if (!status) {
             AR_DEBUG_PRINTF(ATH_DEBUG_ANY,
                ("AR6K: virtual scatter transfers enabled (max scatter items:%d: maxlen:%d) \n",
                    DEV_GET_MAX_MSG_PER_BUNDLE(pDev), DEV_GET_MAX_BUNDLE_LENGTH(pDev)));
@@ -844,7 +844,7 @@ int DevSetupMsgBundling(AR6K_DEVICE *pDev, int MaxMsgsPerTransfer)
                    DEV_GET_MAX_MSG_PER_BUNDLE(pDev), DEV_GET_MAX_BUNDLE_LENGTH(pDev)));
    }

    if (A_SUCCESS(status)) {
    if (!status) {
            /* for the recv path, the maximum number of bytes per recv bundle is just limited
             * by the maximum transfer size at the HIF layer */
        pDev->MaxRecvBundleSize = pDev->HifScatterInfo.MaxTransferSizePerScatterReq;
+10 −6
Original line number Diff line number Diff line
@@ -276,11 +276,15 @@ int DevCopyScatterListToFromDMABuffer(HIF_SCATTER_REQ *pReq, A_BOOL FromDMA);
    
    /* copy any READ data back into scatter list */        
#define DEV_FINISH_SCATTER_OPERATION(pR)				\
    if (A_SUCCESS((pR)->CompletionStatus) &&                  \
do {									\
	if (!((pR)->CompletionStatus) &&				\
	    !((pR)->Request & HIF_WRITE) &&				\
	    ((pR)->ScatterMethod == HIF_SCATTER_DMA_BOUNCE)) {		\
         (pR)->CompletionStatus = DevCopyScatterListToFromDMABuffer((pR),FROM_DMA_BUFFER); \
    }
		(pR)->CompletionStatus =				\
			DevCopyScatterListToFromDMABuffer((pR),		\
							  FROM_DMA_BUFFER); \
	}								\
} while (0)
    
    /* copy any WRITE data to bounce buffer */
static INLINE int DEV_PREPARE_SCATTER_OPERATION(HIF_SCATTER_REQ *pReq)  {
+2 −2
Original line number Diff line number Diff line
@@ -372,7 +372,7 @@ static void DevGetEventAsyncHandler(void *Context, HTC_PACKET *pPacket)
                 * go get the next message */
            status = pDev->MessagePendingCallback(pDev->HTCContext, &lookAhead, 1, NULL, &fetched);

            if (A_SUCCESS(status) && !fetched) {
            if (!status && !fetched) {
                    /* HTC layer could not pull out messages due to lack of resources, stop IRQ processing */
                AR_DEBUG_PRINTF(ATH_DEBUG_IRQ,("MessagePendingCallback did not pull any messages, force-ack \n"));
                DevAsyncIrqProcessComplete(pDev);
@@ -725,7 +725,7 @@ int DevDsrHandler(void *context)

    }

    if (A_SUCCESS(status) && !asyncProc) {
    if (!status && !asyncProc) {
            /* Ack the interrupt only if :
             *  1. we did not get any errors in processing interrupts
             *  2. there are no outstanding async processing requests */
Loading