diff options
author | Kevin McKinney <klmckinney1@gmail.com> | 2012-10-12 23:49:35 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-19 13:42:23 -0700 |
commit | 7878626e14cb30df9bc1c9f38293bfa8a887e806 (patch) | |
tree | f8768364c18d1f608188320a6118199ffb4edac4 /drivers/staging/bcm | |
parent | f637035c680b67d15bddfc293ddee3214c23e2e1 (diff) | |
download | op-kernel-dev-7878626e14cb30df9bc1c9f38293bfa8a887e806.zip op-kernel-dev-7878626e14cb30df9bc1c9f38293bfa8a887e806.tar.gz |
Staging: bcm: Remove unneeded do while loop in InterfaceRDM.
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')
-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 8c9cf2d..f43e644 100644 --- a/drivers/staging/bcm/InterfaceMisc.c +++ b/drivers/staging/bcm/InterfaceMisc.c @@ -6,7 +6,6 @@ int InterfaceRDM(PS_INTERFACE_ADAPTER psIntfAdapter, int len) { int bytes; - unsigned short usRetries = 0; if (!psIntfAdapter) { BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_PRINTK, 0, 0, "Interface Adapter is NULL"); @@ -29,27 +28,21 @@ int InterfaceRDM(PS_INTERFACE_ADAPTER psIntfAdapter, } psIntfAdapter->psAdapter->DeviceAccess = TRUE; - do { - bytes = usb_control_msg(psIntfAdapter->udev, - usb_rcvctrlpipe(psIntfAdapter->udev, 0), - 0x02, - 0xC2, - (addr & 0xFFFF), - ((addr >> 16) & 0xFFFF), - buff, - len, - 5000); - - usRetries++; - if (-ENODEV == bytes) { - psIntfAdapter->psAdapter->device_removed = TRUE; - break; - } + bytes = usb_control_msg(psIntfAdapter->udev, + usb_rcvctrlpipe(psIntfAdapter->udev, 0), + 0x02, + 0xC2, + (addr & 0xFFFF), + ((addr >> 16) & 0xFFFF), + buff, + len, + 5000); - } while ((bytes < 0) && (usRetries < MAX_RDM_WRM_RETIRES)); + if (-ENODEV == bytes) + psIntfAdapter->psAdapter->device_removed = TRUE; if (bytes < 0) - BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, RDM, DBG_LVL_ALL, "RDM failed status :%d, retires :%d", bytes, usRetries); + BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, RDM, DBG_LVL_ALL, "RDM failed status :%d", bytes); else BCM_DEBUG_PRINT(psIntfAdapter->psAdapter, DBG_TYPE_OTHERS, RDM, DBG_LVL_ALL, "RDM sent %d", bytes); |