Skip to contentSkip to conversation

Input: egalax_ts_serial - switch to use scnprintf() to suppress truncation warning

PATCH New Andy Shevchenko 1 participant 1 message Jan 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: egalax_ts_serial - 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.

---
 drivers/input/touchscreen/egalax_ts_serial.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/touchscreen/egalax_ts_serial.c +1 -2
index 07a4aa1c19bb..5f284490a298 100644
@@ -108,8 +108,7 @@ static int egalax_connect(struct serio *serio, struct serio_driver *drv)
 
 	egalax->serio = serio;
 	egalax->input = input_dev;
-	snprintf(egalax->phys, sizeof(egalax->phys),
-		 "%s/input0", serio->phys);
+	scnprintf(egalax->phys, sizeof(egalax->phys), "%s/input0", serio->phys);
 
 	input_dev->name = "EETI eGalaxTouch Serial TouchScreen";
 	input_dev->phys = egalax->phys;
Signature · 1 line
2.50.1