[PATCH 05/16] staging: octeon-usb: simplify if statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Simplify if statement to avoid deep nesting.

Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
 drivers/staging/octeon-usb/octeon-hcd.c | 33 +++++++++++++++------------------
 1 file changed, 15 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/octeon-usb/octeon-hcd.c b/drivers/staging/octeon-usb/octeon-hcd.c
index 726ec5d..39854ab 100644
--- a/drivers/staging/octeon-usb/octeon-hcd.c
+++ b/drivers/staging/octeon-usb/octeon-hcd.c
@@ -2768,26 +2768,23 @@ static int cvmx_usb_poll_channel(struct cvmx_usb_state *usb, int channel)
 			 */
 			if (cvmx_usb_pipe_needs_split(usb, pipe)) {
 				if (transaction->stage ==
-				    CVMX_USB_STAGE_NON_CONTROL)
+				    CVMX_USB_STAGE_NON_CONTROL) {
 					transaction->stage =
 						CVMX_USB_STAGE_NON_CONTROL_SPLIT_COMPLETE;
-				else {
-					if (buffer_space_left &&
-					    (bytes_in_last_packet ==
-					     pipe->max_packet))
-						transaction->stage =
-							CVMX_USB_STAGE_NON_CONTROL;
-					else {
-						if (transaction->type ==
-						    CVMX_USB_TRANSFER_INTERRUPT)
-							pipe->next_tx_frame +=
-								pipe->interval;
-							cvmx_usb_perform_complete(
-								usb,
-								pipe,
-								transaction,
-								CVMX_USB_COMPLETE_SUCCESS);
-					}
+				} else if (buffer_space_left &&
+					   (bytes_in_last_packet ==
+					   pipe->max_packet)) {
+					transaction->stage =
+						CVMX_USB_STAGE_NON_CONTROL;
+				} else {
+					if (transaction->type ==
+					    CVMX_USB_TRANSFER_INTERRUPT)
+						pipe->next_tx_frame +=
+							pipe->interval;
+					cvmx_usb_perform_complete(usb,
+								  pipe,
+								  transaction,
+								  CVMX_USB_COMPLETE_SUCCESS);
 				}
 			} else {
 				if ((pipe->device_speed ==
-- 
2.4.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux