From: Richard Leitner Date: Wed, 8 Oct 2014 21:24:15 +0000 (-0700) Subject: Input: avoid negative input device numbers X-Git-Tag: v3.18-rc1~6^2~5^2~7 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=bf1d50fa74df0339c925aa7e2ff9de60a42c30be;p=~emulex%2Finfiniband.git Input: avoid negative input device numbers 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/input.c b/drivers/input/input.c index d2e06cc7e17..0f175f55782 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1789,7 +1789,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);