Commit 24db713f authored by Leo Kim's avatar Leo Kim Committed by Greg Kroah-Hartman
Browse files

staging: wilc1000: remove the macro WILC_ERRORREPORT



This patch removes the macro WILC_ERRORREPORT which is not used
anymore by replacing it with the plain statements.

The compiler complains the build warnings in some functions for WILC_CATCH and
ERRORHANDLER as unused definitions. So, this patch also removes WILC_CATCH and
ERRORHANDLER from some of functions.

Signed-off-by: default avatarLeo Kim <leo.kim@atmel.com>
Signed-off-by: default avatarTony Cho <tony.cho@atmel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7dc1d0cc
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
/* File Includes                                                             */
/*****************************************************************************/
#include "coreconfigurator.h"
#include <linux/errno.h>
/*****************************************************************************/
/* Constants                                                                 */
/*****************************************************************************/
@@ -429,7 +430,7 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)
	/* Check whether the received message type is 'N' */
	if ('N' != u8MsgType) {
		PRINT_ER("Received Message format incorrect.\n");
		WILC_ERRORREPORT(s32Error, WILC_FAIL);
		return -EFAULT;
	}

	/* Extract message ID */
@@ -525,7 +526,6 @@ s32 ParseNetworkInfo(u8 *pu8MsgBuffer, tstrNetworkInfo **ppstrNetworkInfo)

	*ppstrNetworkInfo = pstrNetworkInfo;

ERRORHANDLER:
	return s32Error;
}

+347 −522

File changed.

Preview size limit exceeded, changes collapsed.

+0 −5
Original line number Diff line number Diff line
@@ -38,11 +38,6 @@



#define WILC_ERRORREPORT(__status__, __err__) do { \
		PRINT_ER("PRINT_ER(%d)\n", __err__); \
		__status__ = __err__; \
		goto ERRORHANDLER; \
} while (0)

#define WILC_CATCH(__status__) \
ERRORHANDLER: \
+47 −51
Original line number Diff line number Diff line
@@ -59,11 +59,15 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
	Message *pstrMessage = NULL;

	if ((!pHandle) || (u32SendBufferSize == 0) || (!pvSendBuffer)) {
		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
		PRINT_ER("pHandle or pvSendBuffer is null\n");
		s32RetStatus = -EFAULT;
		goto ERRORHANDLER;
	}

	if (pHandle->bExiting) {
		WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
		PRINT_ER("pHandle fail\n");
		s32RetStatus = -EFAULT;
		goto ERRORHANDLER;
	}

	spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -97,14 +101,12 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,

	up(&pHandle->hSem);

	WILC_CATCH(s32RetStatus)
	{
ERRORHANDLER:
	/* error occured, free any allocations */
	if (pstrMessage) {
		kfree(pstrMessage->pvBuffer);
		kfree(pstrMessage);
	}
	}

	return s32RetStatus;
}
@@ -125,11 +127,13 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,

	if ((!pHandle) || (u32RecvBufferSize == 0)
	    || (!pvRecvBuffer) || (!pu32ReceivedLength)) {
		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
		PRINT_ER("pHandle or pvRecvBuffer is null\n");
		return -EINVAL;
	}

	if (pHandle->bExiting) {
		WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
		PRINT_ER("pHandle fail\n");
		return -EFAULT;
	}

	spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -138,12 +142,6 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,

	down(&pHandle->hSem);

	if (s32RetStatus == WILC_TIMEOUT) {
		/* timed out, just exit without consumeing the message */
		spin_lock_irqsave(&pHandle->strCriticalSection, flags);
		pHandle->u32ReceiversCount--;
		spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
	} else {
	/* other non-timeout scenarios */
	if (s32RetStatus) {
		PRINT_ER("Non-timeout\n");
@@ -151,7 +149,8 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
	}

	if (pHandle->bExiting) {
			WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
		PRINT_ER("pHandle fail\n");
		return -EFAULT;
	}

	spin_lock_irqsave(&pHandle->strCriticalSection, flags);
@@ -159,13 +158,15 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
	pstrMessage = pHandle->pstrMessageList;
	if (!pstrMessage) {
		spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
			WILC_ERRORREPORT(s32RetStatus, WILC_FAIL);
		PRINT_ER("pstrMessage is null\n");
		return -EFAULT;
	}
	/* check buffer size */
	if (u32RecvBufferSize < pstrMessage->u32Length)	{
		spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
		up(&pHandle->hSem);
			WILC_ERRORREPORT(s32RetStatus, WILC_BUFFER_OVERFLOW);
		PRINT_ER("u32RecvBufferSize overflow\n");
		return -EOVERFLOW;
	}

	/* consume the message */
@@ -179,11 +180,6 @@ int wilc_mq_recv(WILC_MsgQueueHandle *pHandle,
	kfree(pstrMessage);

	spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
	}

	WILC_CATCH(s32RetStatus)
	{
	}

	return s32RetStatus;
}
+2 −7
Original line number Diff line number Diff line
@@ -374,7 +374,6 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
	struct wiphy *wiphy;
	s32 s32Freq;
	struct ieee80211_channel *channel;
	s32 s32Error = WILC_SUCCESS;
	struct cfg80211_bss *bss = NULL;

	priv = (struct wilc_priv *)pUserVoid;
@@ -391,7 +390,8 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
			     ||
			     (((s32)pstrNetworkInfo->s8rssi) * 100) > 100)
			    ) {
				WILC_ERRORREPORT(s32Error, WILC_FAIL);
				PRINT_ER("wiphy signal type fial\n");
				return;
			}

			if (pstrNetworkInfo != NULL) {
@@ -485,11 +485,6 @@ static void CfgScanResult(tenuScanEvent enuScanEvent, tstrNetworkInfo *pstrNetwo
			up(&(priv->hSemScanReq));
		}
	}


	WILC_CATCH(s32Error)
	{
	}
}