From 509c9d973055e3d98c0d2aa2cb40c9139526fd74 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Thu, 27 Jan 2011 20:04:20 -0800 Subject: 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: Joe Perches Acked-by: Vipin Mehta Signed-off-by: Greg Kroah-Hartman --- .../staging/ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'drivers/staging/ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c') diff --git a/drivers/staging/ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c b/drivers/staging/ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c index 6b61dc4c41c..8c801b09827 100644 --- a/drivers/staging/ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c +++ b/drivers/staging/ath6kl/htc2/AR6000/ar6k_gmbox_hciuart.c @@ -82,11 +82,16 @@ typedef struct { #define LOCK_HCI_TX(t) A_MUTEX_LOCK(&(t)->HCITxLock); #define UNLOCK_HCI_TX(t) A_MUTEX_UNLOCK(&(t)->HCITxLock); -#define DO_HCI_RECV_INDICATION(p,pt) \ -{ AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("HCI: Indicate Recv on packet:0x%lX status:%d len:%d type:%d \n", \ - (unsigned long)(pt),(pt)->Status, A_SUCCESS((pt)->Status) ? (pt)->ActualLength : 0, HCI_GET_PACKET_TYPE(pt))); \ - (p)->HCIConfig.pHCIPktRecv((p)->HCIConfig.pContext, (pt)); \ -} +#define DO_HCI_RECV_INDICATION(p, pt) \ +do { \ + AR_DEBUG_PRINTF(ATH_DEBUG_RECV, \ + ("HCI: Indicate Recv on packet:0x%lX status:%d len:%d type:%d \n", \ + (unsigned long)(pt), \ + (pt)->Status, \ + !(pt)->Status ? (pt)->ActualLength : 0, \ + HCI_GET_PACKET_TYPE(pt))); \ + (p)->HCIConfig.pHCIPktRecv((p)->HCIConfig.pContext, (pt)); \ +} while (0) #define DO_HCI_SEND_INDICATION(p,pt) \ { AR_DEBUG_PRINTF(ATH_DEBUG_SEND,("HCI: Indicate Send on packet:0x%lX status:%d type:%d \n", \ @@ -175,7 +180,7 @@ static int InitTxCreditState(GMBOX_PROTO_HCI_UART *pProt) } while (FALSE); - if (A_SUCCESS(status)) { + if (!status) { pProt->CreditsAvailable = pProt->CreditsMax; AR_DEBUG_PRINTF(ATH_DEBUG_ANY,("HCI : InitTxCreditState - credits avail: %d, size: %d \n", pProt->CreditsAvailable, pProt->CreditSize)); @@ -768,7 +773,7 @@ static int HCITrySend(GMBOX_PROTO_HCI_UART *pProt, HTC_PACKET *pPacket, A_BOOL S if (Synchronous) { A_ASSERT(pPacket != NULL); - if (A_SUCCESS(status) && (!synchSendComplete)) { + if (!status && (!synchSendComplete)) { status = A_EBUSY; A_ASSERT(FALSE); LOCK_HCI_TX(pProt); @@ -865,7 +870,7 @@ int GMboxProtocolInstall(AR6K_DEVICE *pDev) } while (FALSE); - if (A_SUCCESS(status)) { + if (!status) { LOCK_AR6K(pDev); DEV_GMBOX_SET_PROTOCOL(pDev, HCIUartMessagePending, -- cgit v1.2.3