]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Input: mtouch - switch to use scnprintf() to suppress truncation warning
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 20 Jan 2026 20:03:35 +0000 (12:03 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 20 Jan 2026 20:17:59 +0000 (12:17 -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/20260113082921.86167-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/mtouch.c

index eefae96a2d40794be9ec1dd249116da971a68a74..0427ae08c39d2c15c8a284b2cee6120d55ce9b1d 100644 (file)
@@ -137,7 +137,7 @@ static int mtouch_connect(struct serio *serio, struct serio_driver *drv)
 
        mtouch->serio = serio;
        mtouch->dev = input_dev;
-       snprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys);
+       scnprintf(mtouch->phys, sizeof(mtouch->phys), "%s/input0", serio->phys);
 
        input_dev->name = "MicroTouch Serial TouchScreen";
        input_dev->phys = mtouch->phys;