]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit82efad30a2563e9b3a987fc218d2f3c664d06bff
tree8c8b828f61aba48335cd9afbd12c628b93d13f15
parent1b8ff811718d80311a4106ac41c0082737723a12
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