Skip to content

Commit 0224ec9

Browse files
g0hl1ndtor
authored andcommitted
Input: serio - avoid negative serio device numbers
Fix the format string for serio device name generation to avoid negative device numbers when the id exceeds the maximum signed integer value. Signed-off-by: Richard Leitner <richard.leitner@skidata.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent bf1d50f commit 0224ec9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/input/serio/serio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,8 @@ static void serio_init_port(struct serio *serio)
524524
spin_lock_init(&serio->lock);
525525
mutex_init(&serio->drv_mutex);
526526
device_initialize(&serio->dev);
527-
dev_set_name(&serio->dev, "serio%ld",
528-
(long)atomic_inc_return(&serio_no) - 1);
527+
dev_set_name(&serio->dev, "serio%lu",
528+
(unsigned long)atomic_inc_return(&serio_no) - 1);
529529
serio->dev.bus = &serio_bus;
530530
serio->dev.release = serio_release_port;
531531
serio->dev.groups = serio_device_attr_groups;

0 commit comments

Comments
 (0)