

The while-loop seemed excessively blocked with
conditionals. By reorganizing the code so timeout is the condition for
the loop and changing the checks within the loop, several lines of code
were removed.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---


 kj-domen/drivers/usb/class/usblp.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff -puN drivers/usb/class/usblp.c~schedule_cleanup-drivers_usb_class_usblp.c drivers/usb/class/usblp.c
--- kj/drivers/usb/class/usblp.c~schedule_cleanup-drivers_usb_class_usblp.c	2005-03-02 10:42:18.000000000 +0100
+++ kj-domen/drivers/usb/class/usblp.c	2005-03-02 10:42:18.000000000 +0100
@@ -637,19 +637,17 @@ static ssize_t usblp_write(struct file *
 
 			timeout = USBLP_WRITE_TIMEOUT;
 			add_wait_queue(&usblp->wait, &wait);
-			while ( 1==1 ) {
-
+			while (timeout) {
 				if (signal_pending(current)) {
 					remove_wait_queue(&usblp->wait, &wait);
 					return writecount ? writecount : -EINTR;
 				}
 				set_current_state(TASK_INTERRUPTIBLE);
-				if (timeout && !usblp->wcomplete) {
-					timeout = schedule_timeout(timeout);
-				} else {
+				if (usblp->wcomplete) {
 					set_current_state(TASK_RUNNING);
 					break;
 				}
+				timeout = schedule_timeout(timeout);
 			}
 			remove_wait_queue(&usblp->wait, &wait);
 		}
_

