Skip to content

Commit

Permalink
[PATCH] tty_io.c: keep davej sane
Browse files Browse the repository at this point in the history
Just comment and next "while" look _very_ wrong.  Place { correctly to hint
unsuspecting ones that it's the end of the loop actually.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Dave Jones <davej@redhat.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Alexey Dobriyan authored and Linus Torvalds committed Sep 29, 2006
1 parent 3bc1fa8 commit 527063b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,9 @@ int tty_insert_flip_string(struct tty_struct *tty, const unsigned char *chars,
tb->used += space;
copied += space;
chars += space;
}
/* There is a small chance that we need to split the data over
several buffers. If this is the case we must loop */
while (unlikely(size > copied));
/* There is a small chance that we need to split the data over
several buffers. If this is the case we must loop */
} while (unlikely(size > copied));
return copied;
}
EXPORT_SYMBOL(tty_insert_flip_string);
Expand Down Expand Up @@ -521,10 +520,9 @@ int tty_insert_flip_string_flags(struct tty_struct *tty,
copied += space;
chars += space;
flags += space;
}
/* There is a small chance that we need to split the data over
several buffers. If this is the case we must loop */
while (unlikely(size > copied));
/* There is a small chance that we need to split the data over
several buffers. If this is the case we must loop */
} while (unlikely(size > copied));
return copied;
}
EXPORT_SYMBOL(tty_insert_flip_string_flags);
Expand Down

0 comments on commit 527063b

Please sign in to comment.