staging: dgnc: replace unnecessary while() with if()
authorDaeseok Youn <daeseok.youn@gmail.com>
Tue, 11 Mar 2014 03:19:06 +0000 (12:19 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Mar 2014 21:37:46 +0000 (14:37 -0700)
commit93c76c9c1dd3de4a3d4ecbd494085c45fce20414
tree8c8b828f61aba48335cd9afbd12c628b93d13f15
parentc0c31b9b2a65c7d8f28f94577cbd234764f3cdcc
staging: dgnc: replace unnecessary while() with if()

It doesn't need to use while loop for getting newrate,
because it always breaks out the end of while loop with
"break". So just replace while with if.

And the type of newrate is "unsigned int", this type
is never less than zero. If it can be set to negative value by
user application with ioctl(), it is not zero but it
can be a unexpected value for setting custom baudrate.

Also smatch says:
drivers/staging/dgnc/dgnc_tty.c:967 dgnc_set_custom_speed() warn:
 unsigned 'newrate' is never less than zero.
drivers/staging/dgnc/dgnc_tty.c:981 dgnc_set_custom_speed() info:
 ignoring unreachable code.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c