]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: touchwin - switch to use scnprintf() to suppress truncation warning
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 20 Jan 2026 20:05:11 +0000 (12:05 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 20 Jan 2026 20:18:02 +0000 (12:18 -0800)
Switch the driver to use scnprintf() to avoid warnings about potential
truncation of "phys" field which we can tolerate.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://patch.msgid.link/20260113082938.89437-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/touchwin.c

index fbd72789ea8095504bc612f82cc5d739f0ac3a40..4b92e8711e1d72791587490b164eee5bc9d445f3 100644 (file)
@@ -118,7 +118,7 @@ static int tw_connect(struct serio *serio, struct serio_driver *drv)
 
        tw->serio = serio;
        tw->dev = input_dev;
-       snprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
+       scnprintf(tw->phys, sizeof(tw->phys), "%s/input0", serio->phys);
 
        input_dev->name = "Touchwindow Serial TouchScreen";
        input_dev->phys = tw->phys;