Skip to contentSkip to conversation

Input: hampshire - 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: hampshire - 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/hampshire.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/hampshire.c +1 -1
index dc0a2482ddd6..2f9b078b652b 100644
@@ -118,7 +118,7 @@ static int hampshire_connect(struct serio *serio, struct serio_driver *drv)
 
 	phampshire->serio = serio;
 	phampshire->dev = input_dev;
-	snprintf(phampshire->phys, sizeof(phampshire->phys),
+	scnprintf(phampshire->phys, sizeof(phampshire->phys),
 		 "%s/input0", serio->phys);
 
 	input_dev->name = "Hampshire Serial TouchScreen";
Signature · 1 line
2.50.1