linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 17:18 [PATCH] use simple_strtoul for unsigned kernel parameters John Bradford
@ 2003-08-18 17:15 ` Larry McVoy
  2003-08-18 19:17   ` Alan Cox
  0 siblings, 1 reply; 13+ messages in thread
From: Larry McVoy @ 2003-08-18 17:15 UTC (permalink / raw)
  To: John Bradford; +Cc: alan, torvalds, jamie, linux-kernel, rusty

On Mon, Aug 18, 2003 at 06:18:30PM +0100, John Bradford wrote:
> Hmmm, at least some Cray machines require three-phase power, though,
> which is a problem for home use.

Huh?  You can get phase converters.  It's a common thing to do for home
shops with metal working tools.

But who cares?  Nobody is going to run a Cray in their home for more than
a few days, the power draw would get too expensive.  So this is well into
"angels in the head of a pin" land.
-- 
---
Larry McVoy              lm at bitmover.com          http://www.bitmover.com/lm

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
@ 2003-08-18 17:18 John Bradford
  2003-08-18 17:15 ` Larry McVoy
  0 siblings, 1 reply; 13+ messages in thread
From: John Bradford @ 2003-08-18 17:18 UTC (permalink / raw)
  To: alan, torvalds; +Cc: jamie, linux-kernel, rusty

> > Well, in theory short/int/long can all be the same size and thus a
> > "unsigned short" may not actually fit in a "long". I think that was the
> > case on the old 64-bit cray machines, for example ("char" was a very slow
> > 8-bit thing, everything else was purely 64-bit).
> > 
> > Not likely something we want to port Linux to, admittedly.
>
> Bear in mind we have the compiler source 8). If someone desperately
> wants to run Linux (probably ucLinux) on their cray they can fix the
> types too.

Hmmm, at least some Cray machines require three-phase power, though,
which is a problem for home use.

Do Cray boxes support virtualisation in hardware, or is it all done in
software?

> Things like the DEC10 (9,18,36 bit) and HLH Orion (word addressed) would
> be a lot more fun but thankfully are extinct 

No architecture is _thankfully_ extinct :-).

John.

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 17:15 ` Larry McVoy
@ 2003-08-18 19:17   ` Alan Cox
  0 siblings, 0 replies; 13+ messages in thread
From: Alan Cox @ 2003-08-18 19:17 UTC (permalink / raw)
  To: Larry McVoy
  Cc: John Bradford, torvalds, jamie, Linux Kernel Mailing List, Rusty Russell

On Llu, 2003-08-18 at 18:15, Larry McVoy wrote:
> But who cares?  Nobody is going to run a Cray in their home for more than
> a few days, the power draw would get too expensive.  So this is well into
> "angels in the head of a pin" land.

If I remember rightly the ELC runs on a single phase with only one CPU
fitted



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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
@ 2003-08-18 17:59 John Bradford
  0 siblings, 0 replies; 13+ messages in thread
From: John Bradford @ 2003-08-18 17:59 UTC (permalink / raw)
  To: john, lm; +Cc: alan, jamie, linux-kernel, rusty, torvalds

> > > But who cares?  Nobody is going to run a Cray in their home for more than
> > > a few days, the power draw would get too expensive.  So this is well into
> > > "angels in the head of a pin" land.
> > 
> > Far from it - the phase converter info has re-awakened my dream of
> > owning a VAX 11/780, and I'm sure I'm not the only one...
>
> Great, then trundle over to comp.sys.dec and have the big fun.  10 seconds
> in google groups would have found you all the info you want.

Good point -  I obviously didn't put too much effort in before the
dream died off the first time :-/.

John.

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
@ 2003-08-18 17:40 John Bradford
  2003-08-18 17:39 ` Larry McVoy
  0 siblings, 1 reply; 13+ messages in thread
From: John Bradford @ 2003-08-18 17:40 UTC (permalink / raw)
  To: john, lm; +Cc: alan, jamie, linux-kernel, rusty, torvalds

> > Hmmm, at least some Cray machines require three-phase power, though,
> > which is a problem for home use.
>
> Huh?  You can get phase converters.  It's a common thing to do for home
> shops with metal working tools.

Interesting, I didn't know you could buy phase converters...

> But who cares?  Nobody is going to run a Cray in their home for more than
> a few days, the power draw would get too expensive.  So this is well into
> "angels in the head of a pin" land.

Far from it - the phase converter info has re-awakened my dream of
owning a VAX 11/780, and I'm sure I'm not the only one...

John.

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 17:40 John Bradford
@ 2003-08-18 17:39 ` Larry McVoy
  0 siblings, 0 replies; 13+ messages in thread
From: Larry McVoy @ 2003-08-18 17:39 UTC (permalink / raw)
  To: John Bradford; +Cc: lm, alan, jamie, linux-kernel, rusty, torvalds

On Mon, Aug 18, 2003 at 06:40:08PM +0100, John Bradford wrote:
> > But who cares?  Nobody is going to run a Cray in their home for more than
> > a few days, the power draw would get too expensive.  So this is well into
> > "angels in the head of a pin" land.
> 
> Far from it - the phase converter info has re-awakened my dream of
> owning a VAX 11/780, and I'm sure I'm not the only one...

Great, then trundle over to comp.sys.dec and have the big fun.  10 seconds
in google groups would have found you all the info you want.
-- 
---
Larry McVoy              lm at bitmover.com          http://www.bitmover.com/lm

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 15:20   ` Linus Torvalds
  2003-08-18 15:31     ` Jamie Lokier
@ 2003-08-18 16:43     ` Alan Cox
  1 sibling, 0 replies; 13+ messages in thread
From: Alan Cox @ 2003-08-18 16:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Rusty Russell, Jamie Lokier, Linux Kernel Mailing List

On Llu, 2003-08-18 at 16:20, Linus Torvalds wrote:
> Well, in theory short/int/long can all be the same size and thus a
> "unsigned short" may not actually fit in a "long". I think that was the
> case on the old 64-bit cray machines, for example ("char" was a very slow
> 8-bit thing, everything else was purely 64-bit).
> 
> Not likely something we want to port Linux to, admittedly.

Bear in mind we have the compiler source 8). If someone desperately
wants to run Linux (probably ucLinux) on their cray they can fix the
types too.

Things like the DEC10 (9,18,36 bit) and HLH Orion (word addressed) would
be a lot more fun but thankfully are extinct 



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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 12:09   ` Jamie Lokier
@ 2003-08-18 15:32     ` Rusty Russell
  0 siblings, 0 replies; 13+ messages in thread
From: Rusty Russell @ 2003-08-18 15:32 UTC (permalink / raw)
  To: Jamie Lokier; +Cc: Linus Torvalds, linux-kernel

In message <20030818120955.GB7147@mail.jlokier.co.uk> you write:
> Rusty Russell wrote:
> > 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
> 
> Do you mean the first part of the comment or the first part of the patch?
> 
> Assuming you mean the patch, you're right: the unsigned short case
> doesn't need to be changed.  It should be anyway because it is just
> the right thing to do.

<shrug>.  Linus took the patch.  If you think it's the Right Thing,
great.

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

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 15:20   ` Linus Torvalds
@ 2003-08-18 15:31     ` Jamie Lokier
  2003-08-18 16:43     ` Alan Cox
  1 sibling, 0 replies; 13+ messages in thread
From: Jamie Lokier @ 2003-08-18 15:31 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Rusty Russell, linux-kernel

Linus Torvalds wrote:
> On Mon, 18 Aug 2003, Rusty Russell wrote:
> > Half right.  The second part is fine, the first part is redundant
> > AFAICT.
> 
> Well, in theory short/int/long can all be the same size and thus a
> "unsigned short" may not actually fit in a "long". I think that was the
> case on the old 64-bit cray machines, for example ("char" was a very slow
> 8-bit thing, everything else was purely 64-bit).

There's the SHARC and C4x architectures, where "char" is 32 bits, the
same as "short", "int" and "long".

-- Jamie

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 10:13 ` Rusty Russell
  2003-08-18 12:09   ` Jamie Lokier
@ 2003-08-18 15:20   ` Linus Torvalds
  2003-08-18 15:31     ` Jamie Lokier
  2003-08-18 16:43     ` Alan Cox
  1 sibling, 2 replies; 13+ messages in thread
From: Linus Torvalds @ 2003-08-18 15:20 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Jamie Lokier, linux-kernel


On Mon, 18 Aug 2003, Rusty Russell wrote:
> 
> Half right.  The second part is fine, the first part is redundant
> AFAICT.

Well, in theory short/int/long can all be the same size and thus a
"unsigned short" may not actually fit in a "long". I think that was the
case on the old 64-bit cray machines, for example ("char" was a very slow
8-bit thing, everything else was purely 64-bit).

Not likely something we want to port Linux to, admittedly.

		Linus


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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18 10:13 ` Rusty Russell
@ 2003-08-18 12:09   ` Jamie Lokier
  2003-08-18 15:32     ` Rusty Russell
  2003-08-18 15:20   ` Linus Torvalds
  1 sibling, 1 reply; 13+ messages in thread
From: Jamie Lokier @ 2003-08-18 12:09 UTC (permalink / raw)
  To: Rusty Russell; +Cc: Linus Torvalds, linux-kernel

Rusty Russell wrote:
> 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

Do you mean the first part of the comment or the first part of the patch?

Assuming you mean the patch, you're right: the unsigned short case
doesn't need to be changed.  It should be anyway because it is just
the right thing to do.

-- Jamie

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

* Re: [PATCH] use simple_strtoul for unsigned kernel parameters
  2003-08-18  0:46 Jamie Lokier
@ 2003-08-18 10:13 ` Rusty Russell
  2003-08-18 12:09   ` Jamie Lokier
  2003-08-18 15:20   ` Linus Torvalds
  0 siblings, 2 replies; 13+ messages in thread
From: Rusty Russell @ 2003-08-18 10:13 UTC (permalink / raw)
  To: Jamie Lokier; +Cc: Linus Torvalds, linux-kernel

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.

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

* [PATCH] use simple_strtoul for unsigned kernel parameters
@ 2003-08-18  0:46 Jamie Lokier
  2003-08-18 10:13 ` Rusty Russell
  0 siblings, 1 reply; 13+ messages in thread
From: Jamie Lokier @ 2003-08-18  0:46 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Rusty Russell, linux-kernel

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.

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

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

end of thread, other threads:[~2003-08-18 19:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-18 17:18 [PATCH] use simple_strtoul for unsigned kernel parameters John Bradford
2003-08-18 17:15 ` Larry McVoy
2003-08-18 19:17   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2003-08-18 17:59 John Bradford
2003-08-18 17:40 John Bradford
2003-08-18 17:39 ` Larry McVoy
2003-08-18  0:46 Jamie Lokier
2003-08-18 10:13 ` Rusty Russell
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

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