lkml.org 
[lkml]   [2017]   [May]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] Input: mousedev - fix implicit conversion warning
Date
Clang warns:

drivers/input/mousedev.c:653:63: error: implicit conversion from 'int'
to 'signed char' changes value from 200 to -56
[-Wconstant-conversion]
client->ps2[1] = 0x60; client->ps2[2] = 3; client->ps2[3] = 200;
~ ^~~

As far as I can tell, from

http://www.computer-engineering.org/ps2mouse/

Under "Command Set" > "0xE9 (Status Request)"

the value 200 is a valid sample rate. An explicit cast silences this
warning.

Signed-off-by: Nick Desaulniers <nick.desaulniers@gmail.com>
---
drivers/input/mousedev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index 0e0ff84088fd..816e2431bba8 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -650,7 +650,9 @@ static void mousedev_generate_response(struct mousedev_client *client,
break;

case 0xe9: /* Get info */
- client->ps2[1] = 0x60; client->ps2[2] = 3; client->ps2[3] = 200;
+ client->ps2[1] = 0x60;
+ client->ps2[2] = 3;
+ client->ps2[3] = (char) 200;
client->bufsiz = 4;
break;

--
2.11.0
\
 
 \ /
  Last update: 2017-05-26 07:22    [W:0.100 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site