staging: speakup: signedness bug in spk_ttyio_in_nowait()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 May 2017 21:27:18 +0000 (00:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 16:56:32 +0000 (18:56 +0200)
On most of the common arches char is signed so it can't ever == 0xff.
Let's fix this by making it a u8.

Fixes: 6b9ad1c742bf ("staging: speakup: add send_xchar, tiocmset and input functionality for tty")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/spk_ttyio.c

index 6e0f042..8ed7c71 100644 (file)
@@ -220,7 +220,7 @@ static unsigned char spk_ttyio_in(void)
 
 static unsigned char spk_ttyio_in_nowait(void)
 {
-       char rv = ttyio_in(0);
+       u8 rv = ttyio_in(0);
 
        return (rv == 0xff) ? 0 : rv;
 }