From: Nick Desaulniers <nick.desaulniers@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: gregkh@linuxfoundation.org,
Nick Desaulniers <nick.desaulniers@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Input: mousedev - fix implicit conversion warning
Date: Thu, 25 May 2017 22:22:16 -0700 [thread overview]
Message-ID: <20170526052217.30624-1-nick.desaulniers@gmail.com> (raw)
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
next reply other threads:[~2017-05-26 5:22 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-26 5:22 Nick Desaulniers [this message]
2017-05-26 15:34 ` [PATCH v2] " Nick Desaulniers
2017-05-26 15:40 ` [PATCH v3] " Nick Desaulniers
2017-05-26 17:07 ` Dmitry Torokhov
2017-05-29 19:22 ` Nick Desaulniers
2017-05-30 2:44 ` Dmitry Torokhov
2017-05-30 5:41 ` [PATCH v4] " Nick Desaulniers
2017-06-06 16:18 ` Nick Desaulniers
2017-06-23 4:16 ` Nick Desaulniers
2017-06-25 18:06 ` Dmitry Torokhov
2017-06-27 1:39 ` Nick Desaulniers
2017-07-12 6:57 ` Nick Desaulniers
2017-07-12 18:19 ` Dmitry Torokhov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170526052217.30624-1-nick.desaulniers@gmail.com \
--to=nick.desaulniers@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®