[openib-general] [PATCH] small cleanup
Michael S. Tsirkin
mst at mellanox.co.il
Tue Feb 22 02:34:51 PST 2005
Replace for(;;) break with a proper C loop.
Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>
Index: sdp_conn.c
===================================================================
--- sdp_conn.c (revision 1857)
+++ sdp_conn.c (working copy)
@@ -837,19 +837,14 @@ void sdp_conn_internal_lock(struct sdp_o
unsigned long f = *flags;
add_wait_queue_exclusive(&(conn->lock.waitq), &wait);
- for (;;) {
+ do {
current->state = TASK_UNINTERRUPTIBLE;
spin_unlock_irqrestore(&(conn->lock.slock), f);
schedule();
spin_lock_irqsave(&(conn->lock.slock), f);
- *flags = f;
-
- if (0 == conn->lock.users) {
-
- break;
- }
- }
+ } while (conn->lock.users);
+ *flags = f;
current->state = TASK_RUNNING;
remove_wait_queue(&(conn->lock.waitq), &wait);
--
MST - Michael S. Tsirkin
More information about the general
mailing list