Commit 3c09bb2e authored by Chaehyun Lim's avatar Chaehyun Lim Committed by Greg Kroah-Hartman

staging: wilc1000: rename strCriticalSection in struct message_queue

This patch renames strCriticalSection to lock to avoid camelcase.
Signed-off-by: default avatarChaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9b849fd9
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
*/ */
int wilc_mq_create(struct message_queue *pHandle) int wilc_mq_create(struct message_queue *pHandle)
{ {
spin_lock_init(&pHandle->strCriticalSection); spin_lock_init(&pHandle->lock);
sema_init(&pHandle->sem, 0); sema_init(&pHandle->sem, 0);
pHandle->pstrMessageList = NULL; pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0; pHandle->u32ReceiversCount = 0;
...@@ -83,7 +83,7 @@ int wilc_mq_send(struct message_queue *pHandle, ...@@ -83,7 +83,7 @@ int wilc_mq_send(struct message_queue *pHandle,
return -ENOMEM; return -ENOMEM;
} }
spin_lock_irqsave(&pHandle->strCriticalSection, flags); spin_lock_irqsave(&pHandle->lock, flags);
/* add it to the message queue */ /* add it to the message queue */
if (!pHandle->pstrMessageList) { if (!pHandle->pstrMessageList) {
...@@ -97,7 +97,7 @@ int wilc_mq_send(struct message_queue *pHandle, ...@@ -97,7 +97,7 @@ int wilc_mq_send(struct message_queue *pHandle,
pstrTailMsg->next = pstrMessage; pstrTailMsg->next = pstrMessage;
} }
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); spin_unlock_irqrestore(&pHandle->lock, flags);
up(&pHandle->sem); up(&pHandle->sem);
...@@ -128,22 +128,22 @@ int wilc_mq_recv(struct message_queue *pHandle, ...@@ -128,22 +128,22 @@ int wilc_mq_recv(struct message_queue *pHandle,
return -EFAULT; return -EFAULT;
} }
spin_lock_irqsave(&pHandle->strCriticalSection, flags); spin_lock_irqsave(&pHandle->lock, flags);
pHandle->u32ReceiversCount++; pHandle->u32ReceiversCount++;
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); spin_unlock_irqrestore(&pHandle->lock, flags);
down(&pHandle->sem); down(&pHandle->sem);
spin_lock_irqsave(&pHandle->strCriticalSection, flags); spin_lock_irqsave(&pHandle->lock, flags);
pstrMessage = pHandle->pstrMessageList; pstrMessage = pHandle->pstrMessageList;
if (!pstrMessage) { if (!pstrMessage) {
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); spin_unlock_irqrestore(&pHandle->lock, flags);
PRINT_ER("pstrMessage is null\n"); PRINT_ER("pstrMessage is null\n");
return -EFAULT; return -EFAULT;
} }
/* check buffer size */ /* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) { if (u32RecvBufferSize < pstrMessage->len) {
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); spin_unlock_irqrestore(&pHandle->lock, flags);
up(&pHandle->sem); up(&pHandle->sem);
PRINT_ER("u32RecvBufferSize overflow\n"); PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW; return -EOVERFLOW;
...@@ -159,7 +159,7 @@ int wilc_mq_recv(struct message_queue *pHandle, ...@@ -159,7 +159,7 @@ int wilc_mq_recv(struct message_queue *pHandle,
kfree(pstrMessage->buf); kfree(pstrMessage->buf);
kfree(pstrMessage); kfree(pstrMessage);
spin_unlock_irqrestore(&pHandle->strCriticalSection, flags); spin_unlock_irqrestore(&pHandle->lock, flags);
return 0; return 0;
} }
...@@ -21,7 +21,7 @@ struct message { ...@@ -21,7 +21,7 @@ struct message {
struct message_queue { struct message_queue {
struct semaphore sem; struct semaphore sem;
spinlock_t strCriticalSection; spinlock_t lock;
bool bExiting; bool bExiting;
u32 u32ReceiversCount; u32 u32ReceiversCount;
struct message *pstrMessageList; struct message *pstrMessageList;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment