Commit c1a33900 authored by Dmitry Torokhov's avatar Dmitry Torokhov

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.comSigned-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 5f82c1e0
...@@ -612,6 +612,7 @@ static psmouse_ret_t cypress_protocol_handler(struct psmouse *psmouse) ...@@ -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) static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate)
{ {
struct cytp_data *cytp = psmouse->private; struct cytp_data *cytp = psmouse->private;
u8 rate_param;
if (rate >= 80) { if (rate >= 80) {
psmouse->rate = 80; psmouse->rate = 80;
...@@ -621,8 +622,8 @@ static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate) ...@@ -621,8 +622,8 @@ static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate)
cytp->mode &= ~CYTP_BIT_HIGH_RATE; cytp->mode &= ~CYTP_BIT_HIGH_RATE;
} }
ps2_command(&psmouse->ps2dev, (unsigned char *)&psmouse->rate, rate_param = (u8)rate;
PSMOUSE_CMD_SETRATE); ps2_command(&psmouse->ps2dev, &rate_param, PSMOUSE_CMD_SETRATE);
} }
static void cypress_disconnect(struct psmouse *psmouse) static void cypress_disconnect(struct psmouse *psmouse)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment