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>
*/
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);
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
sema_init(&pHandle->sem, 0);
pHandle->pstrMessageList = NULL;
pHandle->u32ReceiversCount = 0;
- spin_lock_irqsave(&pHandle->strCriticalSection, flags);
+ spin_lock_irqsave(&pHandle->lock, flags);
/* add it to the message queue */
if (!pHandle->pstrMessageList) {
/* add it to the message queue */
if (!pHandle->pstrMessageList) {
pstrTailMsg->next = pstrMessage;
}
pstrTailMsg->next = pstrMessage;
}
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+ spin_unlock_irqrestore(&pHandle->lock, flags);
- 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);
- spin_lock_irqsave(&pHandle->strCriticalSection, flags);
+ spin_lock_irqsave(&pHandle->lock, flags);
pstrMessage = pHandle->pstrMessageList;
if (!pstrMessage) {
pstrMessage = pHandle->pstrMessageList;
if (!pstrMessage) {
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+ spin_unlock_irqrestore(&pHandle->lock, flags);
PRINT_ER("pstrMessage is null\n");
return -EFAULT;
}
/* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) {
PRINT_ER("pstrMessage is null\n");
return -EFAULT;
}
/* check buffer size */
if (u32RecvBufferSize < pstrMessage->len) {
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+ spin_unlock_irqrestore(&pHandle->lock, flags);
up(&pHandle->sem);
PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW;
up(&pHandle->sem);
PRINT_ER("u32RecvBufferSize overflow\n");
return -EOVERFLOW;
kfree(pstrMessage->buf);
kfree(pstrMessage);
kfree(pstrMessage->buf);
kfree(pstrMessage);
- spin_unlock_irqrestore(&pHandle->strCriticalSection, flags);
+ spin_unlock_irqrestore(&pHandle->lock, flags);
struct message_queue {
struct semaphore sem;
struct message_queue {
struct semaphore sem;
- spinlock_t strCriticalSection;
bool bExiting;
u32 u32ReceiversCount;
struct message *pstrMessageList;
bool bExiting;
u32 u32ReceiversCount;
struct message *pstrMessageList;