From: Alexey Dobriyan 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 Cc: Dave Jones Acked-by: Alan Cox Signed-off-by: Andrew Morton --- drivers/char/tty_io.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff -puN drivers/char/tty_io.c~tty_ioc-keep-davej-sane drivers/char/tty_io.c --- a/drivers/char/tty_io.c~tty_ioc-keep-davej-sane +++ a/drivers/char/tty_io.c @@ -483,10 +483,9 @@ int tty_insert_flip_string(struct tty_st 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); @@ -521,10 +520,9 @@ int tty_insert_flip_string_flags(struct 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); _