From: Kevin McKinney Date: Mon, 28 Nov 2011 01:51:45 +0000 (-0500) Subject: Staging: bcm: Clean up patch that calls semaphore down_trylock directly. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=fef5675ecbeb0c92d49c8b350e1324164bb348a5;p=openwrt%2Fstaging%2Fblogic.git Staging: bcm: Clean up patch that calls semaphore down_trylock directly. This patch evaluates/calls the down_trylock locking function directly, instead of storing the results in a variable and evaluating the variable. These changes were made in: IOCTL_BCM_BUFFER_DOWNLOAD_STOP and IOCTL_BCM_BUFFER_DOWNLOAD_START. Signed-off-by: Kevin McKinney Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index d0a0b10c5d4e..e6b20c80db52 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -756,8 +756,7 @@ cntrlEnd: } case IOCTL_BCM_BUFFER_DOWNLOAD_START: { - INT NVMAccess = down_trylock(&Adapter->NVMRdmWrmLock); - if (NVMAccess) { + if (down_trylock(&Adapter->NVMRdmWrmLock)) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, OSAL_DBG, DBG_LVL_ALL, "IOCTL_BCM_CHIP_RESET not allowed as EEPROM Read/Write is in progress\n"); return -EACCES; @@ -862,9 +861,7 @@ cntrlEnd: } case IOCTL_BCM_BUFFER_DOWNLOAD_STOP: { - INT NVMAccess = down_trylock(&Adapter->NVMRdmWrmLock); - - if (NVMAccess) { + if (down_trylock(&Adapter->NVMRdmWrmLock)) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "FW download blocked as EEPROM Read/Write is in progress\n"); up(&Adapter->fw_download_sema);