diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-06-29 00:47:23 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-07-03 22:48:53 +0200 |
commit | c1a339001191e60f70c4da827569b3bb27500a9a (patch) | |
tree | aea73e34a9813cb3bef05118519239bafdc6c7ac /drivers/input/mouse | |
parent | Input: elan_i2c - do not leave interrupt disabled on suspend failure (diff) | |
download | linux-c1a339001191e60f70c4da827569b3bb27500a9a.tar.xz linux-c1a339001191e60f70c4da827569b3bb27500a9a.zip |
Input: cypress_ps2 - clean up setting reporting rate
Casting an integer field containing desired rate to a pointer to bytes
works on little endian architectures where the driver is used, but not
a good practice. Use a temporary of proper type instead.
Link: https://lore.kernel.org/r/20240628224728.2180126-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/cypress_ps2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c index c693130bef41..32b55b2b9b76 100644 --- a/drivers/input/mouse/cypress_ps2.c +++ b/drivers/input/mouse/cypress_ps2.c @@ -612,6 +612,7 @@ static psmouse_ret_t cypress_protocol_handler(struct psmouse *psmouse) static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate) { struct cytp_data *cytp = psmouse->private; + u8 rate_param; if (rate >= 80) { psmouse->rate = 80; @@ -621,8 +622,8 @@ static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate) cytp->mode &= ~CYTP_BIT_HIGH_RATE; } - ps2_command(&psmouse->ps2dev, (unsigned char *)&psmouse->rate, - PSMOUSE_CMD_SETRATE); + rate_param = (u8)rate; + ps2_command(&psmouse->ps2dev, &rate_param, PSMOUSE_CMD_SETRATE); } static void cypress_disconnect(struct psmouse *psmouse) |