linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Aniroop Mathur <aniroop.mathur@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	dtor@mail.ru
Subject: Re: [PATCH] Input: Initialize input_no by -1
Date: Fri, 28 Nov 2014 21:40:49 +0530	[thread overview]
Message-ID: <CADYu30-cJzdk4-xdc3rTaQh0SdDpMsmp2qFi_GYz5ma++FsMpA@mail.gmail.com> (raw)
In-Reply-To: <1416931715-2902-1-git-send-email-aniroop.mathur@gmail.com>

Dear Mr. Torokhov and Linux Input Community,
Greetings of the day !!

Kindly update about below patch.
I have corrected the spaces and sent it on Tue, Nov 25, 2014.

Thanks,
Aniroop Mathur

On Tue, Nov 25, 2014 at 9:38 PM, Aniroop Mathur
<aniroop.mathur@gmail.com> wrote:
>
> This patch initializes input_no by -1 in order to avoid extra subtraction
> operation performed everytime for allocation of an input device.
>
> Signed-off-by: Aniroop Mathur <aniroop.mathur@gmail.com>
> ---
>  drivers/input/input.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 29ca0bb..01fe49e 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -1774,7 +1774,7 @@ EXPORT_SYMBOL_GPL(input_class);
>   */
>  struct input_dev *input_allocate_device(void)
>  {
> -       static atomic_t input_no = ATOMIC_INIT(0);
> +       static atomic_t input_no = ATOMIC_INIT(-1);
>         struct input_dev *dev;
>
>         dev = kzalloc(sizeof(struct input_dev), GFP_KERNEL);
> @@ -1789,7 +1789,7 @@ struct input_dev *input_allocate_device(void)
>                 INIT_LIST_HEAD(&dev->node);
>
>                 dev_set_name(&dev->dev, "input%ld",
> -                            (unsigned long) atomic_inc_return(&input_no) - 1);
> +                            (unsigned long) atomic_inc_return(&input_no));
>
>                 __module_get(THIS_MODULE);
>         }
> --
> 1.9.1
>

  reply	other threads:[~2014-11-28 16:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 16:08 [PATCH] Input: Initialize input_no by -1 Aniroop Mathur
2014-11-28 16:10 ` Aniroop Mathur [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-12-02 16:45 [PATCH] Input : " Aniroop Mathur
2014-12-02 23:29 ` Dmitry Torokhov
2014-12-03  5:57   ` Dmitry Torokhov
2014-11-21 18:48 [PATCH] Input: " Aniroop Mathur
2014-11-24  3:20 ` Aniroop Mathur
2014-11-25  8:40 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADYu30-cJzdk4-xdc3rTaQh0SdDpMsmp2qFi_GYz5ma++FsMpA@mail.gmail.com \
    --to=aniroop.mathur@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dtor@mail.ru \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).