From: Dmitry Torokhov Date: Wed, 4 Jun 2025 04:47:36 +0000 (-0700) Subject: Input: psmouse - switch to use scnprintf() to suppress truncation warning X-Git-Tag: v6.16-rc5~21^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=805f5bbaa507a7e15333ad7bb34d517251de4eb9;p=thirdparty%2Flinux.git Input: psmouse - switch to use scnprintf() to suppress truncation warning Switch the driver to use scnprintf() to avoid warnings about potential truncation of "phys" field which we can tolerate. Reported-by: Andy Shevchenko Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index a2c9f7144864e..77ea7da3b1c50 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -1600,7 +1600,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) psmouse_pre_receive_byte, psmouse_receive_byte); INIT_DELAYED_WORK(&psmouse->resync_work, psmouse_resync); psmouse->dev = input_dev; - snprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); + scnprintf(psmouse->phys, sizeof(psmouse->phys), "%s/input0", serio->phys); psmouse_set_state(psmouse, PSMOUSE_INITIALIZING);