]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: atkbd - switch to use scnprintf() to suppress truncation warning
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 4 Jun 2025 04:45:44 +0000 (21:45 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 4 Jun 2025 04:51:25 +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/keyboard/atkbd.c

index 3ff2fcf05ad5ec1b46f2d98498b1aebeeddf685f..c9e1127578b9ed31bb58f7e6a73b465f689efe24 100644 (file)
@@ -1191,8 +1191,8 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
                         "AT %s Set %d keyboard",
                         atkbd->translated ? "Translated" : "Raw", atkbd->set);
 
-       snprintf(atkbd->phys, sizeof(atkbd->phys),
-                "%s/input0", atkbd->ps2dev.serio->phys);
+       scnprintf(atkbd->phys, sizeof(atkbd->phys),
+                 "%s/input0", atkbd->ps2dev.serio->phys);
 
        input_dev->name = atkbd->name;
        input_dev->phys = atkbd->phys;