linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Jamie Lokier <jamie@shareable.org>
Cc: Linus Torvalds <torvalds@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] use simple_strtoul for unsigned kernel parameters
Date: Mon, 18 Aug 2003 20:13:33 +1000	[thread overview]
Message-ID: <20030818101524.5B12D2C019@lists.samba.org> (raw)
In-Reply-To: Your message of "Mon, 18 Aug 2003 01:46:18 +0100." <20030818004618.GA5094@mail.jlokier.co.uk>

In message <20030818004618.GA5094@mail.jlokier.co.uk> you write:
> The largest "unsigned int" value doesn't fit in a "long", on many machines.
> So we should use simple_strtoul, not simple_strtol, to decode these values.

Half right.  The second part is fine, the first part is redundant
AFAICT.

Rusty.

> Enjoy,
> -- Jamie
> 
> --- orig-2.5.75/kernel/params.c	2003-07-08 21:44:26.000000000 +0100
> +++ laptop-2.5.75/kernel/params.c	2003-08-17 03:17:40.116594605 +0100
> @@ -165,9 +165,9 @@
>  	}
>  
>  STANDARD_PARAM_DEF(short, short, "%hi", long, simple_strtol);
> -STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", long, simple_strtol);
> +STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, simple_strtoul);
>  STANDARD_PARAM_DEF(int, int, "%i", long, simple_strtol);
> -STANDARD_PARAM_DEF(uint, unsigned int, "%u", long, simple_strtol);
> +STANDARD_PARAM_DEF(uint, unsigned int, "%u", unsigned long, simple_strtoul);
>  STANDARD_PARAM_DEF(long, long, "%li", long, simple_strtol);
>  STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, simple_strtoul);
>  

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

  reply	other threads:[~2003-08-18 10:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-18  0:46 [PATCH] use simple_strtoul for unsigned kernel parameters Jamie Lokier
2003-08-18 10:13 ` Rusty Russell [this message]
2003-08-18 12:09   ` Jamie Lokier
2003-08-18 15:32     ` Rusty Russell
2003-08-18 15:20   ` Linus Torvalds
2003-08-18 15:31     ` Jamie Lokier
2003-08-18 16:43     ` Alan Cox
2003-08-18 17:18 John Bradford
2003-08-18 17:15 ` Larry McVoy
2003-08-18 19:17   ` Alan Cox
2003-08-18 17:40 John Bradford
2003-08-18 17:39 ` Larry McVoy
2003-08-18 17:59 John Bradford

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=20030818101524.5B12D2C019@lists.samba.org \
    --to=rusty@rustcorp.com.au \
    --cc=jamie@shareable.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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).