linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: avoid negative input device numbers
@ 2014-10-08 20:42 Richard Leitner
  2014-10-08 20:49 ` [RFC] avoid (theoretical) conflicts of input device file names Richard Leitner
  2014-10-08 21:25 ` [PATCH] input: avoid negative input device numbers Dmitry Torokhov
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Leitner @ 2014-10-08 20:42 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 input 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/input.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index 236bc56..6be6982 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1791,7 +1791,7 @@ struct input_dev *input_allocate_device(void)
 		INIT_LIST_HEAD(&dev->h_list);
 		INIT_LIST_HEAD(&dev->node);
 
-		dev_set_name(&dev->dev, "input%ld",
+		dev_set_name(&dev->dev, "input%lu",
 			     (unsigned long) atomic_inc_return(&input_no) - 1);
 
 		__module_get(THIS_MODULE);
-- 
2.1.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-10-08 21:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-08 20:42 [PATCH] input: avoid negative input device numbers Richard Leitner
2014-10-08 20:49 ` [RFC] avoid (theoretical) conflicts of input device file names Richard Leitner
2014-10-08 21:30   ` Dmitry Torokhov
2014-10-08 21:25 ` [PATCH] input: avoid negative input device numbers Dmitry Torokhov
2014-10-08 21:30   ` Dmitry Torokhov
2014-10-08 21:49     ` Richard Leitner

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).