linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Richard Leitner <me@g0hl1n.net>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	richard.leitner@skidata.com
Subject: Re: [PATCH] serio: avoid negative serio device numbers
Date: Wed, 8 Oct 2014 15:22:00 -0700	[thread overview]
Message-ID: <20141008222200.GH15198@dtor-ws> (raw)
In-Reply-To: <20141008235427.55d0963f@frodo>

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

      reply	other threads:[~2014-10-08 22:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-08 21:54 [PATCH] serio: avoid negative serio device numbers Richard Leitner
2014-10-08 22:22 ` Dmitry Torokhov [this message]

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=20141008222200.GH15198@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=me@g0hl1n.net \
    --cc=richard.leitner@skidata.com \
    /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).