staging: speakup: fix misuse of kstrtol() in handle_goto()
authorDaeseok Youn <daeseok.youn@gmail.com>
Wed, 9 Apr 2014 10:45:46 +0000 (19:45 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Apr 2014 18:41:44 +0000 (11:41 -0700)
commitef35a4f44bdc6f8c9f99a561fd1fd318305a4d98
tree8beea2bf45b41e7b91fd544da43d89330ccb96d5
parentff8ebe6448e98df59a8c7e7e93876f8f3d6a8b19
staging: speakup: fix misuse of kstrtol() in handle_goto()

A string of goto_buf has a number followed by x or y.
e.g. "3x" means move 3 lines down.
The kstrtol() returns an error(-EINVAL) with this string so
go_pos has unsigned a value of that error.
And also "*cp" has not expected value.

And fix sparse warnings:
 drivers/staging/speakup/main.c:1901 handle_goto() warn: unsigned '(speakup_console[vc->vc_num]->go_pos)' is never less than zero.
 drivers/staging/speakup/main.c:1911 handle_goto() warn: unsigned '(speakup_console[vc->vc_num]->go_pos)' is never less than zero.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/main.c