Commit Graph

64 Commits

Author SHA1 Message Date
Chaehyun Lim 8231dfc087 staging: wilc1000: wilc_msgqueue: release semaphore in error path
It should be called up(&mq->sem) to release semaphore before returning
error codes as -EFAULT when list is empty.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:33:09 -08:00
Chaehyun Lim e9670aba93 staging: wilc1000: wilc_msgqueue: use standard struct list_head
This patch uses standard struct list_head in struct message and
message_queue instead of custom linked list.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:33:09 -08:00
Chaehyun Lim 2c8e2dcb88 staging: wilc1000: fix logical continuations
This patch fixes logical continuations found by checkpatch
CHECK: Logical continuations should be on the previous line

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 7adf4f312b staging: wilc1000: fix coding style of kmalloc usage
This patch fixes coding style of kmalloc usage found by checkpatch.
CHECK: Prefer kmalloc(sizeof(*new_msg)...) over kmalloc(sizeof(struct message)...)

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 5b8e7ba9fd staging: wilc1000: rename pstrMessage in wilc_mq_recv
This patch renames pstrMessage to msg to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 62082cbe72 staging: wilc1000: rename pu32ReceivedLength in wilc_mq_recv
This patch renames pu32ReceivedLength to recv_len to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim e8f2d1f19c staging: wilc1000: rename u32RecvBufferSize in wilc_mq_recv
This patch renames u32RecvBufferSize to recv_buf_size to avoid
camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim f034b01ea6 staging: wilc1000: rename pvRecvBuffer in wilc_mq_recv
This patch renames pvRecvBuffer to recv_buf to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 24752783ba staging: wilc1000: rename pHandle in wilc_mq_recv
This patch renames pHandle to mq to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim dee1bf76d9 staging: wilc1000: fix return error code
Three argument are checked at the beginning of wilc_mq_send whether
they are valid arguments or not. It is correct to use return error code
as -EINVAL, not -EFAULT.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim bd07b0076b staging: wilc1000: rename pstrTailMsg in wilc_mq_send
This patch renames pstrTailMsg to tail_msg to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 669fd5077f staging: wilc1000: rename pstrMessage in wilc_mq_send
This patch renames pstrMessage to new_msg to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 81e886e0b7 staging: wilc1000: rename u32SendBufferSize in wilc_mq_send
This patch renames u32SendBufferSize to send_buf_size to avoid
camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 832f4fa5f1 staging: wilc1000: rename pvSendBuffer in wilc_mq_send
This patch renames pvSendBuffer to send_buf to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 5eb359756f staging: wilc1000: rename pHandle in wilc_mq_send
This patch renames pHandle to mq to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim fca978b718 staging: wilc1000: rename pstrMessge in wilc_mq_destroy
This patch renames pstrMessge to msg to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim d742f67ee1 staging: wilc1000: rename pHandle in wilc_mq_destroy
This patch renames pHandle to mq to avoid camelcase

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 2cc08b4f26 staging: wilc1000: rename pHandle in wilc_mq_create
This patch renames pHandle to mq to avoid camelcase

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim f9d26e21a8 staging: wilc1000: rename pstrMessageList in struct message_queue
This patch renames pstrMessageList to msg_list to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim ec815ec5fd staging: wilc1000: rename u32ReceiversCount in struct message_queue
This patch renames u32ReceiversCount to recv_count to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim c700cab301 staging: wilc1000: rename bExiting in struct message_queue
This patch renames bExiting to exiting to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 3c09bb2e1e staging: wilc1000: rename strCriticalSection in struct message_queue
This patch renames strCriticalSection to lock to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 9b849fd9ad staging: wilc1000: rename hSem in struct message_queue
This patch renames hSem to sem to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 5ba8955404 staging: wilc1000: rename struct WILC_MsgQueueHandle
This patch removes typedef from struct WILC_MsgQueueHandle and renames
it to struct message_queue.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 3356116124 staging: wilc1000: rename pstrNext in struct message
This patch renames pstrNext to next to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim d3ff0580b9 staging: wilc1000: rename u32Length in struct message
This patch renames u32Length to len to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim 78d50f94f0 staging: wilc1000: rename pvBuffer in struct message
This patch renames pvBuffer to buf to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim d16791bfd5 staging: wilc1000: rename struct __Message_struct
This patch renames typedef from struct __Message_struct and renames it
to struct message.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:21:18 -08:00
Chaehyun Lim eec826439d staging: wilc1000: remove redundant check in wilc_mq_recv
At the beginning of wilc_mq_recv, it is checked if pHandle->bExiting is
false or true. There is no need to check it again at the middle of this
function. So just remove it.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-03 15:20:15 -08:00
Chandra S Gorentla ff5d40a4d3 staging: wilc1000: Remove 'if' statement, which is always false
- 'if' which is always false is removed
- variable associated with this 'if' is deleted

Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-18 14:47:27 -08:00
Leo Kim dbef61e749 staging: wilc1000: wilc_msgqueue.c : remove goto statement
This patch removes goto statement and moves the spin lock position.
If a memory allocation fails, directly returns an error.
The spin lock actually protects the pHandle. Therefore, call spin lock just
before pHandle is used.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Glen Lee <glen.lee@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:16:52 +09:00
Shraddha Barke c22cbec069 Staging: wilc1000: wilc_msgqueue: Use kmemdup instead of kmalloc and memcpy
Replace kmalloc and memcpy with kmemdup.
Problem found using coccicheck

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 21:01:28 -07:00
Chaehyun Lim 947239070a staging: wilc1000: remove wilc_platform.h include file
This patch removes wilc_platform.h include file that is defined in
wilc_msgqueue.h file. After removing it, compilation error occurs so
that it is included two header files as <linux/semaphore.h> and
<linux/slab.h> at wilc_msgqueue.h and wilc_msgqueue.c

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 02:38:30 +02:00
Chaehyun Lim 967c606a90 staging: wilc1000: wilc_msgqueue.c: replace s32RetStatus with result
This patch replaces s32RetStatus with result to avoid CamelCase in
wilc_msgqueue.c

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-20 19:04:14 -07:00
Leo Kim 6569738ad5 staging: wilc1000: remove wilc_errorsupport.h
This patch removes the wilc_errorsupport.h which is not used anymore and
also deletes #include "wilc_errorsupport.h" from the source code.

In addition, adds linux_wlan_common.h file in the wilc_msgqueue.c file
in order to use PRINT macros defined in the linux_wlan_common.h file.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:40:13 -07:00
Leo Kim e6e12661d8 staging: wilc1000: replace wilc error types with the generic error types
This patch replaces the error types defined by wilc driver with the
generic error types provided by the Linux kernel.
- WILC_SUCCESS			0
- WILC_FAIL				-EFAULT
- WILC_BUSY				-EBUSY
- WILC_INVALID_ARGUMENT		-EINVAL
- WILC_INVALID_STATE		-EINVAL
- WILC_BUFFER_OVERFLOW		-EOVERFLOW
- WILC_NULL_PTR			-EFAULT
- WILC_TIMEOUT			-ETIMEDOUT
- WILC_NOT_FOUND			-ENOENT
- WILC_NO_MEM			-ENOMEM

After then removes all wilc definitions.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:40:13 -07:00
Leo Kim 24db713fe5 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: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:39:06 -07:00
Leo Kim 7dc1d0cc1f staging: wilc1000: remove the macro WILC_ERRORCHECK
This patch removes the macro WILC_ERRORCHECK which is not used
anymore by replacing it with the plain statements.

This patch also removes the WILC_CATCH macros from some of functions not
to make the build warnings.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:38:17 -07:00
Leo Kim 7ae433631e staging: wilc1000: remove a macro WILC_NULLCHECK
This patch replaces WILC_NULLCHECK with the plain statements and then removes
the macro WILC_NULLCHECK in wilc_errorsupport.h which is not used anymore.

Signed-off-by: Leo Kim <leo.kim@atmel.com>
Signed-off-by: Tony Cho <tony.cho@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-16 21:38:17 -07:00
Chaehyun Lim d9998a91fe staging: wilc1000: wilc_msgqueue.c: use kmalloc with GFP_ATOMIC
This patch use kmalloc with GFP_ATOMIC instead of WILC_MALLOC.
It is inside the spin lock region.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:45 -07:00
Chaehyun Lim 1b128f632d staging: wilc1000: rename WILC_MsgQueueDestroy to wilc_mq_destroy
This patch replaces WILC_MsgQueueDestroy to wilc_mq_destroy to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim b986e33e1e staging: wilc1000: rename WILC_MsgQueueRecv to wilc_mq_recv
This patch replaces WILC_MsgQueueRecv with wilc_mq_recv
to shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim 79198138a8 staging: wilc1000: rename WILC_MsgQueueSend to wilc_mq_send
This patch replaces WILC_MsgQueueSend with wilc_mq_send to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim cd08fc7813 staging: wilc1000: rename WILC_MsgQueueCreate to wilc_mq_create
This patch replaces WILC_MsgQueueCreate with wilc_mq_create to
shorten function name and avoid CamelCase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim bd56018a87 staging: wilc1000: replace WILC_ErrNo by int type
This patch replaces WILC_ErrNo with int type.
WILC_ErrNo typedef is also removed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim bb9c2e7a9d staging: wilc1000: wilc_msgqueue.c: fix bool comparison style
This patch changes bool comparison style found by checkpatch.pl
CHECK: Using comparison to true is error prone

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim ce118546d4 staging: wilc1000: wilc_msgqueue.c: remove kfree NULL check
This patch removes kfree NULL check.
WARNING: kfree(NULL) is safe and this check is probably not required.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim ae177a2afc staging: wilc1000: wilc_msgqueue.c: use ! operator instead of NULL comparison
This patch uses ! operator instead of NULL comparison.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:29 -07:00
Chaehyun Lim 96cab4cdc6 staging: wilc1000: wilc_msgqueue.c: remove unnecessary parentheses
This patch remove unnecessary parentheses found by checkpatch.pl
CHECK: Unnecessary parentheses around pHandle->hSem

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:28 -07:00
Chaehyun Lim b6583f7415 staging: wilc1000: wilc_msgqueue.c: remove blank line before a close brace
This patch removes blank line before a close brace "}"
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12 18:24:28 -07:00