diff options
author | Kevin McKinney | 2012-10-13 05:49:36 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2012-10-19 22:42:23 +0200 |
commit | 1e2731eb503e7ddb09fe02d955918e466ad1b0a4 (patch) | |
tree | 6603964ec27f5fbc7db4766dafe94421b395f802 /drivers/staging/bcm/InterfaceMisc.c | |
parent | Staging: bcm: Remove unneeded do while loop in InterfaceRDM. (diff) | |
download | kernel-qcow2-linux-1e2731eb503e7ddb09fe02d955918e466ad1b0a4.tar.gz kernel-qcow2-linux-1e2731eb503e7ddb09fe02d955918e466ad1b0a4.tar.xz kernel-qcow2-linux-1e2731eb503e7ddb09fe02d955918e466ad1b0a4.zip |
Staging: bcm: Remove unneeded do while loop in InterfaceWRM.
This patch removes an unneeded do while loop which
sends a control message to bcm usb device. In this case,
the loop executes once because usRetries is
initialized to zero. After the first iteration
this variable will be 1. Therefore, the statement:
"usRetries < MAX_RDM_WRM_RETIRES" will evaluate to
false causing the do while statement to execute
once because MAX_RDM_WRM_RETIRES is equal to 1.
Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/bcm/InterfaceMisc.c')
-rw-r--r-- | drivers/staging/bcm/InterfaceMisc.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/drivers/staging/bcm/InterfaceMisc.c b/drivers/staging/bcm/InterfaceMisc.c index f43e644752a8..a101f8f93764 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -56,7 +56,6 @@ int InterfaceWRM(PS_INTERFACE_ADAPTER psIntfAdapter, int len) { int retval = 0; - unsigned short usRetries = 0; if (!psIntfAdapter) { BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Interface Adapter is NULL"); @@ -80,27 +79,21 @@ int InterfaceWRM(PS_INTERFACE_ADAPTER psIntfAdapter, psIntfAdapter->psAdapter->DeviceAccess = TRUE; - do { - retval = usb_control_msg(psIntfAdapter->udev, - usb_sndctrlpipe(psIntfAdapter->udev, 0), - 0x01, - 0x42, - (addr & 0xFFFF), - ((addr >> 16) & 0xFFFF), - buff, - len, - 5000); - - usRetries++; - if (-ENODEV == retval) { - psIntfAdapter->psAdapter->device_removed = TRUE; - break; - } + retval = usb_control_msg(psIntfAdapter->udev, + usb_sndctrlpipe(psIntfAdapter->udev, 0), + 0x01, + 0x42, + (addr & 0xFFFF), + ((addr >> 16) & 0xFFFF), + buff, + len, + 5000); - } while ((retval < 0) && (usRetries < MAX_RDM_WRM_RETIRES)); + if (-ENODEV == retval) + psIntfAdapter->psAdapter->device_removed = TRUE; if (retval < 0) { - BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, WRM, DBG_LVL_ALL, "WRM failed status :%d, retires :%d", retval, usRetries); + BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, WRM, DBG_LVL_ALL, "WRM failed status :%d", retval); psIntfAdapter->psAdapter->DeviceAccess = FALSE; return retval; } else { |