diff options
author | Javier Martinez Canillas <martinez.javier@gmail.com> | 2011-02-12 04:38:24 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-18 13:21:56 -0800 |
commit | 7227ba06479f981f5cf9977a7eeb3a20d30dc501 (patch) | |
tree | 04855815a88e4900645a6ec260a88d12180794f1 /drivers/staging/bcm | |
parent | a7d3976edc32e6041f9d68c79ba64a17d5ec5095 (diff) | |
download | linux-stable-7227ba06479f981f5cf9977a7eeb3a20d30dc501.tar.gz linux-stable-7227ba06479f981f5cf9977a7eeb3a20d30dc501.tar.bz2 linux-stable-7227ba06479f981f5cf9977a7eeb3a20d30dc501.zip |
Staging: bcm: Bcmchar: Fix style issues on bcm_char_read()
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/bcm')
-rw-r--r-- | drivers/staging/bcm/Bcmchar.c | 52 |
1 files changed, 28 insertions, 24 deletions
diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index 2a3f64ccefec..2064c2e901cc 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -96,59 +96,63 @@ static int bcm_char_release(struct inode *inode, struct file *filp) return 0; } -static ssize_t bcm_char_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos) +static ssize_t bcm_char_read(struct file *filp, char __user *buf, size_t size, + loff_t *f_pos) { PPER_TARANG_DATA pTarang = filp->private_data; PMINI_ADAPTER Adapter = pTarang->Adapter; - struct sk_buff* Packet = NULL; + struct sk_buff *Packet = NULL; ssize_t PktLen = 0; - int wait_ret_val=0; + int wait_ret_val = 0; + unsigned long ret = 0; wait_ret_val = wait_event_interruptible(Adapter->process_read_wait_queue, - (pTarang->RxAppControlHead || Adapter->device_removed)); - if((wait_ret_val == -ERESTARTSYS)) - { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Exiting as i've been asked to exit!!!\n"); + (pTarang->RxAppControlHead || + Adapter->device_removed)); + if ((wait_ret_val == -ERESTARTSYS)) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, + "Exiting as i've been asked to exit!!!\n"); return wait_ret_val; } - if(Adapter->device_removed) - { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Device Removed... Killing the Apps...\n"); + if (Adapter->device_removed) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, + "Device Removed... Killing the Apps...\n"); return -ENODEV; } - if(FALSE == Adapter->fw_download_done) + if (FALSE == Adapter->fw_download_done) return -EACCES; - down( &Adapter->RxAppControlQueuelock); + down(&Adapter->RxAppControlQueuelock); - if(pTarang->RxAppControlHead) - { + if (pTarang->RxAppControlHead) { Packet = pTarang->RxAppControlHead; - DEQUEUEPACKET(pTarang->RxAppControlHead,pTarang->RxAppControlTail); + DEQUEUEPACKET(pTarang->RxAppControlHead, + pTarang->RxAppControlTail); pTarang->AppCtrlQueueLen--; } - up(&Adapter->RxAppControlQueuelock); + up(&Adapter->RxAppControlQueuelock); - if(Packet) - { + if (Packet) { PktLen = Packet->len; - if(copy_to_user(buf, Packet->data, min_t(size_t, PktLen, size))) - { + ret = copy_to_user(buf, Packet->data, + min_t(size_t, PktLen, size)); + if (ret) { dev_kfree_skb(Packet); - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_PRINTK, 0, 0, "\nReturning from copy to user failure \n"); + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, + "Returning from copy to user failure\n"); return -EFAULT; } - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "Read %zd Bytes From Adapter packet = %p by process %d!\n", PktLen, Packet, current->pid); dev_kfree_skb(Packet); } - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "<====\n"); - return PktLen; + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "<\n"); + return PktLen; } static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg) |