Skip to content

Commit

Permalink
Staging: bcm: Clean up patch that calls semaphore down_trylock directly.
Browse files Browse the repository at this point in the history
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 <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kevin McKinney authored and Greg Kroah-Hartman committed Nov 29, 2011
1 parent 70bd439 commit fef5675
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/staging/bcm/Bcmchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
}

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;
Expand Down Expand Up @@ -862,9 +861,7 @@ static long bcm_char_ioctl(struct file *filp, UINT cmd, ULONG arg)
}

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);
Expand Down

0 comments on commit fef5675

Please sign in to comment.