Input: psmouse - switch to use scnprintf() to suppress truncation warning
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 4 Jun 2025 04:47:36 +0000 (21:47 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 4 Jun 2025 04:51:28 +0000 (21:51 -0700)
Switch the driver to use scnprintf() to avoid warnings about potential
truncation of "phys" field which we can tolerate.

Reported-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/psmouse-base.c

index a2c9f7144864e4725e377c1ad904e7dc6f873e9b..77ea7da3b1c503ddeb38d90f88ba35f723d759fe 100644 (file)
@@ -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);