From: Richard Leitner Date: Wed, 8 Oct 2014 22:21:32 +0000 (-0700) Subject: Input: serio - avoid negative serio device numbers X-Git-Tag: v4.6-rc1~9^2~468 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0224ec9e9f111b1c39ec00a10de4858061b4afea;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/serio/serio.c b/drivers/input/serio/serio.c index b29134d..d399b8b 100644 --- a/drivers/input/serio/serio.c +++ b/drivers/input/serio/serio.c @@ -524,8 +524,8 @@ static void serio_init_port(struct serio *serio) spin_lock_init(&serio->lock); mutex_init(&serio->drv_mutex); device_initialize(&serio->dev); - dev_set_name(&serio->dev, "serio%ld", - (long)atomic_inc_return(&serio_no) - 1); + dev_set_name(&serio->dev, "serio%lu", + (unsigned long)atomic_inc_return(&serio_no) - 1); serio->dev.bus = &serio_bus; serio->dev.release = serio_release_port; serio->dev.groups = serio_device_attr_groups;