diff mbox

[4/4] staging: wilc1000: return -EINVAL for invalid argument checking

Message ID 1439819071-30000-4-git-send-email-chaehyun.lim@gmail.com (mailing list archive)
State Not Applicable
Delegated to: Kalle Valo
Headers show

Commit Message

Chaehyun Lim Aug. 17, 2015, 1:44 p.m. UTC
This patch uses -EINVAL for invalid argument checking instead of using
WILC_ERRORREPORT with WILC_INVALID_ARGUMENT.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Greg KH Aug. 17, 2015, 7:53 p.m. UTC | #1
On Mon, Aug 17, 2015 at 10:44:31PM +0900, Chaehyun Lim wrote:
> This patch uses -EINVAL for invalid argument checking instead of using
> WILC_ERRORREPORT with WILC_INVALID_ARGUMENT.
> 
> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
> ---
>  drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
> index dd87448..561ff88 100644
> --- a/drivers/staging/wilc1000/wilc_msgqueue.c
> +++ b/drivers/staging/wilc1000/wilc_msgqueue.c
> @@ -61,7 +61,7 @@ s32 WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
>  	Message *pstrMessage = NULL;
>  
>  	if ((pHandle == NULL) || (u32SendBufferSize == 0) || (pvSendBuffer == NULL)) {
> -		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
> +		return -EINVAL;

Watch out, WILC_ERRORREPORT has a goto in it, so I don't know if you can
always just do a "simple" return like this.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index dd87448..561ff88 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -61,7 +61,7 @@  s32 WILC_MsgQueueSend(WILC_MsgQueueHandle *pHandle,
 	Message *pstrMessage = NULL;
 
 	if ((pHandle == NULL) || (u32SendBufferSize == 0) || (pvSendBuffer == NULL)) {
-		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+		return -EINVAL;
 	}
 
 	if (pHandle->bExiting == true) {
@@ -128,7 +128,7 @@  s32 WILC_MsgQueueRecv(WILC_MsgQueueHandle *pHandle,
 	unsigned long flags;
 	if ((pHandle == NULL) || (u32RecvBufferSize == 0)
 	    || (pvRecvBuffer == NULL) || (pu32ReceivedLength == NULL)) {
-		WILC_ERRORREPORT(s32RetStatus, WILC_INVALID_ARGUMENT);
+		return -EINVAL;
 	}
 
 	if (pHandle->bExiting == true) {