Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+3 -2
+3 -2
drivers/input/mouse/cypress_ps2.c
··· 612 612 static void cypress_set_rate(struct psmouse *psmouse, unsigned int rate) 613 613 { 614 614 struct cytp_data *cytp = psmouse->private; 615 + u8 rate_param; 615 616 616 617 if (rate >= 80) { 617 618 psmouse->rate = 80; ··· 622 621 cytp->mode &= ~CYTP_BIT_HIGH_RATE; 623 622 } 624 623 625 - ps2_command(&psmouse->ps2dev, (unsigned char *)&psmouse->rate, 626 - PSMOUSE_CMD_SETRATE); 624 + rate_param = (u8)rate; 625 + ps2_command(&psmouse->ps2dev, &rate_param, PSMOUSE_CMD_SETRATE); 627 626 } 628 627 629 628 static void cypress_disconnect(struct psmouse *psmouse)