* [PATCH] serio: avoid negative serio device numbers
@ 2014-10-08 21:54 Richard Leitner
2014-10-08 22:22 ` Dmitry Torokhov
0 siblings, 1 reply; 2+ messages in thread
From: Richard Leitner @ 2014-10-08 21:54 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, linux-kernel, richard.leitner
From: Richard Leitner <richard.leitner@skidata.com>
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>
---
drivers/input/serio/serio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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;
--
2.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serio: avoid negative serio device numbers
2014-10-08 21:54 [PATCH] serio: avoid negative serio device numbers Richard Leitner
@ 2014-10-08 22:22 ` Dmitry Torokhov
0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2014-10-08 22:22 UTC (permalink / raw)
To: Richard Leitner; +Cc: linux-input, linux-kernel, richard.leitner
On Wed, Oct 08, 2014 at 11:54:27PM +0200, Richard Leitner wrote:
> From: Richard Leitner <richard.leitner@skidata.com>
>
> 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>
Applied, thank you.
> ---
> drivers/input/serio/serio.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> 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;
> --
> 2.1.1
>
--
Dmitry
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-10-08 22:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 21:54 [PATCH] serio: avoid negative serio device numbers Richard Leitner
2014-10-08 22:22 ` Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).