linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel-rng: Undo mess made by an 80 column extremist
@ 2007-06-07 15:22 Alan Cox
  2007-06-07 15:23 ` Jeff Garzik
  2007-06-07 21:17 ` Krzysztof Halasa
  0 siblings, 2 replies; 23+ messages in thread
From: Alan Cox @ 2007-06-07 15:22 UTC (permalink / raw)
  To: akpm, linux-kernel, jeff

The intel-rng printed a nice well formatted message when the port was
disabled. Someone then came along and blindly trashed it by screwing up a
trim down to 80 columns.

Put it back into the right format and keep the overlong lines as the
result is also MUCH easier to read in this specific case.

Signed-off-by: Alan Cox <alan@redhat.com>

diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.22-rc4-mm2/drivers/char/hw_random/intel-rng.c linux-2.6.22-rc4-mm2/drivers/char/hw_random/intel-rng.c
--- linux.vanilla-2.6.22-rc4-mm2/drivers/char/hw_random/intel-rng.c	2007-06-07 14:25:57.000000000 +0100
+++ linux-2.6.22-rc4-mm2/drivers/char/hw_random/intel-rng.c	2007-06-07 14:32:36.000000000 +0100
@@ -296,12 +296,10 @@
 	     (BIOS_CNTL_LOCK_ENABLE_MASK|BIOS_CNTL_WRITE_ENABLE_MASK))
 	    == BIOS_CNTL_LOCK_ENABLE_MASK) {
 		static __initdata /*const*/ char warning[] =
-			KERN_WARNING PFX "Firmware space is locked read-only. "
-			KERN_WARNING PFX "If you can't or\n don't want to "
-			KERN_WARNING PFX "disable this in firmware setup, and "
-			KERN_WARNING PFX "if\n you are certain that your "
-			KERN_WARNING PFX "system has a functional\n RNG, try"
-			KERN_WARNING PFX "using the 'no_fwh_detect' option.\n";
+			KERN_WARNING PFX "Firmware space is locked read-only. If you can't or\n"
+			KERN_WARNING PFX "don't want to disable this in firmware setup, and if\n"
+			KERN_WARNING PFX "you are certain that your system has a functional\n"
+			KERN_WARNING PFX "RNG, try using the 'no_fwh_detect' option.\n";
 
 		if (no_fwh_detect)
 			return -ENODEV;

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 15:22 [PATCH] intel-rng: Undo mess made by an 80 column extremist Alan Cox
@ 2007-06-07 15:23 ` Jeff Garzik
  2007-06-07 15:44   ` Alan Cox
  2007-06-07 21:17 ` Krzysztof Halasa
  1 sibling, 1 reply; 23+ messages in thread
From: Jeff Garzik @ 2007-06-07 15:23 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-kernel

On Thu, Jun 07, 2007 at 04:22:51PM +0100, Alan Cox wrote:
> The intel-rng printed a nice well formatted message when the port was
> disabled. Someone then came along and blindly trashed it by screwing up a
> trim down to 80 columns.
> 
> Put it back into the right format and keep the overlong lines as the
> result is also MUCH easier to read in this specific case.
> 
> Signed-off-by: Alan Cox <alan@redhat.com>

Acked-by: Jeff Garzik <jeff@garzik.org>

I'm not the driver maintainer anymore, so I'm not actually going to push
this one.



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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 15:23 ` Jeff Garzik
@ 2007-06-07 15:44   ` Alan Cox
  2007-06-07 17:22     ` Jeff Garzik
  0 siblings, 1 reply; 23+ messages in thread
From: Alan Cox @ 2007-06-07 15:44 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: akpm, linux-kernel

On Thu, 7 Jun 2007 11:23:08 -0400
Jeff Garzik <jeff@garzik.org> wrote:

> On Thu, Jun 07, 2007 at 04:22:51PM +0100, Alan Cox wrote:
> > The intel-rng printed a nice well formatted message when the port was
> > disabled. Someone then came along and blindly trashed it by screwing up a
> > trim down to 80 columns.
> > 
> > Put it back into the right format and keep the overlong lines as the
> > result is also MUCH easier to read in this specific case.
> > 
> > Signed-off-by: Alan Cox <alan@redhat.com>
> 
> Acked-by: Jeff Garzik <jeff@garzik.org>
> 
> I'm not the driver maintainer anymore, so I'm not actually going to push
> this one.

Then please send a patch for the MAINTAINERS file

Alan

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 15:44   ` Alan Cox
@ 2007-06-07 17:22     ` Jeff Garzik
  0 siblings, 0 replies; 23+ messages in thread
From: Jeff Garzik @ 2007-06-07 17:22 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-kernel

On Thu, Jun 07, 2007 at 04:44:09PM +0100, Alan Cox wrote:
> On Thu, 7 Jun 2007 11:23:08 -0400
> Jeff Garzik <jeff@garzik.org> wrote:
> 
> > On Thu, Jun 07, 2007 at 04:22:51PM +0100, Alan Cox wrote:
> > > The intel-rng printed a nice well formatted message when the port was
> > > disabled. Someone then came along and blindly trashed it by screwing up a
> > > trim down to 80 columns.
> > > 
> > > Put it back into the right format and keep the overlong lines as the
> > > result is also MUCH easier to read in this specific case.
> > > 
> > > Signed-off-by: Alan Cox <alan@redhat.com>
> > 
> > Acked-by: Jeff Garzik <jeff@garzik.org>
> > 
> > I'm not the driver maintainer anymore, so I'm not actually going to push
> > this one.
> 
> Then please send a patch for the MAINTAINERS file

hrm, I thought that had already been fixed, by the new maintainer.

Will do.

	Jeff




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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 15:22 [PATCH] intel-rng: Undo mess made by an 80 column extremist Alan Cox
  2007-06-07 15:23 ` Jeff Garzik
@ 2007-06-07 21:17 ` Krzysztof Halasa
  2007-06-07 21:32   ` Alistair John Strachan
                     ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Krzysztof Halasa @ 2007-06-07 21:17 UTC (permalink / raw)
  To: Alan Cox; +Cc: akpm, linux-kernel, jeff

Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

> The intel-rng printed a nice well formatted message when the port was
> disabled. Someone then came along and blindly trashed it by screwing up a
> trim down to 80 columns.

Perhaps we should drop that 80-column style and use some 120+?
X or no X, almost all people now have more lines and columns on their
displays than MDA 20 years ago.

132 to match text VGA perhaps?
80 can be left for the actual _output_, I mean number of chars printed
by kernel code.
-- 
Krzysztof Halasa

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 21:17 ` Krzysztof Halasa
@ 2007-06-07 21:32   ` Alistair John Strachan
  2007-06-07 22:06     ` Krzysztof Halasa
  2007-06-07 22:32   ` Daniel Hazelton
  2007-06-08  1:44   ` John Stoffel
  2 siblings, 1 reply; 23+ messages in thread
From: Alistair John Strachan @ 2007-06-07 21:32 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Alan Cox, akpm, linux-kernel, jeff

On Thursday 07 June 2007 22:17:18 Krzysztof Halasa wrote:
> Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > The intel-rng printed a nice well formatted message when the port was
> > disabled. Someone then came along and blindly trashed it by screwing up a
> > trim down to 80 columns.
>
> Perhaps we should drop that 80-column style and use some 120+?
> X or no X, almost all people now have more lines and columns on their
> displays than MDA 20 years ago.
>
> 132 to match text VGA perhaps?
> 80 can be left for the actual _output_, I mean number of chars printed
> by kernel code.

I personally buy the argument that 80 cols helps remind people that they've 
used too many indentation depths and should redesign their code. I think it's 
a good thing to stick to where possible, even if just from a design 
perspective.

There are some cases such as the one Alan has pointed out here where being 
strictly 80 cols seems more destructive than useful, but those are the 
exception, not the rule (IMO).

-- 
Cheers,
Alistair.

Final year Computer Science undergraduate.
1F2 55 South Clerk Street, Edinburgh, UK.

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 21:32   ` Alistair John Strachan
@ 2007-06-07 22:06     ` Krzysztof Halasa
  2007-06-08  1:08       ` H. Peter Anvin
  0 siblings, 1 reply; 23+ messages in thread
From: Krzysztof Halasa @ 2007-06-07 22:06 UTC (permalink / raw)
  To: Alistair John Strachan; +Cc: Alan Cox, akpm, linux-kernel, jeff

Alistair John Strachan <s0348365@sms.ed.ac.uk> writes:

> I personally buy the argument that 80 cols helps remind people that they've 
> used too many indentation depths and should redesign their code.
> I think it's 
> a good thing to stick to where possible, even if just from a design 
> perspective.

How many is too many? A function with 2 "if" means 3 tabs = 24 characters
for just indentation. Add a printk(KERN_DEBUG "\n"); and you can print
ca. 30 characters without having to break the string. This is crazy.

> There are some cases such as the one Alan has pointed out here where being 
> strictly 80 cols seems more destructive than useful, but those are the 
> exception, not the rule (IMO).

Well... I was forced to split functions making the code less readable
and more complicated just to avoid these 80-columns. A short function
with more indent levels may be way more readable than a redesigned one
with this requirement in mind.

I'd just state the code has to be readable and laid out with some sanity
but 80 columns give us nothing WRT this.

We already review new code and spot such problems (and smaller ones)
without using the 80-cols rule.
-- 
Krzysztof Halasa

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 21:17 ` Krzysztof Halasa
  2007-06-07 21:32   ` Alistair John Strachan
@ 2007-06-07 22:32   ` Daniel Hazelton
  2007-06-07 22:37     ` Krzysztof Halasa
  2007-06-07 22:46     ` Jesper Juhl
  2007-06-08  1:44   ` John Stoffel
  2 siblings, 2 replies; 23+ messages in thread
From: Daniel Hazelton @ 2007-06-07 22:32 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Alan Cox, akpm, linux-kernel, jeff

On Thursday 07 June 2007 17:17:18 Krzysztof Halasa wrote:
> Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > The intel-rng printed a nice well formatted message when the port was
> > disabled. Someone then came along and blindly trashed it by screwing up a
> > trim down to 80 columns.
>
> Perhaps we should drop that 80-column style and use some 120+?
> X or no X, almost all people now have more lines and columns on their
> displays than MDA 20 years ago.
>
> 132 to match text VGA perhaps?
> 80 can be left for the actual _output_, I mean number of chars printed
> by kernel code.

Why? My consoles are *all* still 80x24 text mode. It's only if I decide to 
monkey with the settings (and why fix what isn't broken?) or when I'm in X 
that I get a bigger screen than that.

I think the general consensus on the 80 character lines isn't for the average 
home user, but for the people that have things like old Wyse terminals and 
such hooked up.

DRH


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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 22:32   ` Daniel Hazelton
@ 2007-06-07 22:37     ` Krzysztof Halasa
  2007-06-07 23:01       ` Daniel Hazelton
  2007-06-07 22:46     ` Jesper Juhl
  1 sibling, 1 reply; 23+ messages in thread
From: Krzysztof Halasa @ 2007-06-07 22:37 UTC (permalink / raw)
  To: Daniel Hazelton; +Cc: Alan Cox, akpm, linux-kernel, jeff

Daniel Hazelton <dhazelton@enter.net> writes:

> Why? My consoles are *all* still 80x24 text mode. It's only if I decide to 
> monkey with the settings (and why fix what isn't broken?) or when I'm in X 
> that I get a bigger screen than that.
>
> I think the general consensus on the 80 character lines isn't for the average 
> home user, but for the people that have things like old Wyse terminals and 
> such hooked up.

Of course! But I don't write code using the system console nor old
Wyse etc. serial terminal and I suspect (almost?) nobody does that.

Do you?

Number of characters printed by the kernel (printk()) - sure, still
80 chars to suid everybody (and yes, printk messages show up on system
consoles).
-- 
Krzysztof Halasa

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 22:32   ` Daniel Hazelton
  2007-06-07 22:37     ` Krzysztof Halasa
@ 2007-06-07 22:46     ` Jesper Juhl
  2007-06-07 23:04       ` Daniel Hazelton
  1 sibling, 1 reply; 23+ messages in thread
From: Jesper Juhl @ 2007-06-07 22:46 UTC (permalink / raw)
  To: Daniel Hazelton; +Cc: Krzysztof Halasa, Alan Cox, akpm, linux-kernel, jeff

On 08/06/07, Daniel Hazelton <dhazelton@enter.net> wrote:
> On Thursday 07 June 2007 17:17:18 Krzysztof Halasa wrote:
> > Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > > The intel-rng printed a nice well formatted message when the port was
> > > disabled. Someone then came along and blindly trashed it by screwing up a
> > > trim down to 80 columns.
> >
> > Perhaps we should drop that 80-column style and use some 120+?
> > X or no X, almost all people now have more lines and columns on their
> > displays than MDA 20 years ago.
> >
> > 132 to match text VGA perhaps?
> > 80 can be left for the actual _output_, I mean number of chars printed
> > by kernel code.
>
> Why? My consoles are *all* still 80x24 text mode. It's only if I decide to
> monkey with the settings (and why fix what isn't broken?) or when I'm in X
> that I get a bigger screen than that.
>
> I think the general consensus on the 80 character lines isn't for the average
> home user, but for the people that have things like old Wyse terminals and
> such hooked up.
>

Hmm, perhaps my eyes are just not as good as other peoples, but my X
runs at 1600x1200 and I have konsole in KDE configured so that when it
is maximized it is very close to a 80x25 window (actually it is 82x31
with a size 18 font).
Nice and readable, if I make the font any smaller to fit more
cols/rows then the text gets too small and my eyes hurt.
Reading kernel code formatted for 80cols fits perfectly for me.


-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 22:37     ` Krzysztof Halasa
@ 2007-06-07 23:01       ` Daniel Hazelton
  0 siblings, 0 replies; 23+ messages in thread
From: Daniel Hazelton @ 2007-06-07 23:01 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Alan Cox, akpm, linux-kernel, jeff

On Thursday 07 June 2007 18:37:45 Krzysztof Halasa wrote:
> Daniel Hazelton <dhazelton@enter.net> writes:
> > Why? My consoles are *all* still 80x24 text mode. It's only if I decide
> > to monkey with the settings (and why fix what isn't broken?) or when I'm
> > in X that I get a bigger screen than that.
> >
> > I think the general consensus on the 80 character lines isn't for the
> > average home user, but for the people that have things like old Wyse
> > terminals and such hooked up.
>
> Of course! But I don't write code using the system console nor old
> Wyse etc. serial terminal and I suspect (almost?) nobody does that.
>
> Do you?

No, I don't use a Wyse terminal, but I do a lot of my coding without X 
running. I don't know why, but it might be because I can then take off my 
glasses and not have to worry about the characters getting too blurred to 
read.


DRH

> Number of characters printed by the kernel (printk()) - sure, still
> 80 chars to suid everybody (and yes, printk messages show up on system
> consoles).



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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 22:46     ` Jesper Juhl
@ 2007-06-07 23:04       ` Daniel Hazelton
  0 siblings, 0 replies; 23+ messages in thread
From: Daniel Hazelton @ 2007-06-07 23:04 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: Krzysztof Halasa, Alan Cox, akpm, linux-kernel, jeff

On Thursday 07 June 2007 18:46:25 Jesper Juhl wrote:
> On 08/06/07, Daniel Hazelton <dhazelton@enter.net> wrote:
> > On Thursday 07 June 2007 17:17:18 Krzysztof Halasa wrote:
> > > Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
> > > > The intel-rng printed a nice well formatted message when the port was
> > > > disabled. Someone then came along and blindly trashed it by screwing
> > > > up a trim down to 80 columns.
> > >
> > > Perhaps we should drop that 80-column style and use some 120+?
> > > X or no X, almost all people now have more lines and columns on their
> > > displays than MDA 20 years ago.
> > >
> > > 132 to match text VGA perhaps?
> > > 80 can be left for the actual _output_, I mean number of chars printed
> > > by kernel code.
> >
> > Why? My consoles are *all* still 80x24 text mode. It's only if I decide
> > to monkey with the settings (and why fix what isn't broken?) or when I'm
> > in X that I get a bigger screen than that.
> >
> > I think the general consensus on the 80 character lines isn't for the
> > average home user, but for the people that have things like old Wyse
> > terminals and such hooked up.
>
> Hmm, perhaps my eyes are just not as good as other peoples, but my X
> runs at 1600x1200 and I have konsole in KDE configured so that when it
> is maximized it is very close to a 80x25 window (actually it is 82x31
> with a size 18 font).
> Nice and readable, if I make the font any smaller to fit more
> cols/rows then the text gets too small and my eyes hurt.
> Reading kernel code formatted for 80cols fits perfectly for me.

I know the feeling Jesper. There are times when I like to take my glasses off 
and set them to the side. When I do that I usually also kill X and work using 
nothing more than the console. The why is simple - my eyes are just that bad. 
If I stay in X and try to use it I wind up with a massive headache after only 
thirty minutes or so.

DRH


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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 22:06     ` Krzysztof Halasa
@ 2007-06-08  1:08       ` H. Peter Anvin
  2007-06-08  1:25         ` Jeff Garzik
  0 siblings, 1 reply; 23+ messages in thread
From: H. Peter Anvin @ 2007-06-08  1:08 UTC (permalink / raw)
  To: Krzysztof Halasa
  Cc: Alistair John Strachan, Alan Cox, akpm, linux-kernel, jeff

Krzysztof Halasa wrote:
> Alistair John Strachan <s0348365@sms.ed.ac.uk> writes:
> 
>> I personally buy the argument that 80 cols helps remind people that they've 
>> used too many indentation depths and should redesign their code.
>> I think it's 
>> a good thing to stick to where possible, even if just from a design 
>> perspective.
> 
> How many is too many? A function with 2 "if" means 3 tabs = 24 characters
> for just indentation. Add a printk(KERN_DEBUG "\n"); and you can print
> ca. 30 characters without having to break the string. This is crazy.
> 

My big concern with the 80-column rule is that it discourages commenting.

	-hpa

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  1:08       ` H. Peter Anvin
@ 2007-06-08  1:25         ` Jeff Garzik
  2007-06-08 10:11           ` Peter Zijlstra
  0 siblings, 1 reply; 23+ messages in thread
From: Jeff Garzik @ 2007-06-08  1:25 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Krzysztof Halasa, Alistair John Strachan, Alan Cox, akpm, linux-kernel

On Thu, Jun 07, 2007 at 06:08:32PM -0700, H. Peter Anvin wrote:
> My big concern with the 80-column rule is that it discourages commenting.

My concern with that logic is that encourages random, super-wide code
lines that varies with each coder.  You are left to the mercy of he with
the widest text window.

The 80-column rule is good as a general guideline, though there are
obvious exceptions.  Comments IMO are not one of them.  That rapidly
creates unreadable code.

	Jeff




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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-07 21:17 ` Krzysztof Halasa
  2007-06-07 21:32   ` Alistair John Strachan
  2007-06-07 22:32   ` Daniel Hazelton
@ 2007-06-08  1:44   ` John Stoffel
  2007-06-08  1:47     ` Jeff Garzik
  2 siblings, 1 reply; 23+ messages in thread
From: John Stoffel @ 2007-06-08  1:44 UTC (permalink / raw)
  To: Krzysztof Halasa; +Cc: Alan Cox, akpm, linux-kernel, jeff


Krzysztof> Perhaps we should drop that 80-column style and use some
Krzysztof> 120+?  X or no X, almost all people now have more lines and
Krzysztof> columns on their displays than MDA 20 years ago.

I don't.  I use a pair of 80x48 xterms or emacs windows side by side
on my monitor with a nice big clear easy to read font.  Itty bitty
fonts are a total pain...

John


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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  1:44   ` John Stoffel
@ 2007-06-08  1:47     ` Jeff Garzik
  2007-06-08  1:56       ` John Stoffel
  0 siblings, 1 reply; 23+ messages in thread
From: Jeff Garzik @ 2007-06-08  1:47 UTC (permalink / raw)
  To: John Stoffel; +Cc: Krzysztof Halasa, Alan Cox, akpm, linux-kernel

On Thu, Jun 07, 2007 at 09:44:57PM -0400, John Stoffel wrote:
> I don't.  I use a pair of 80x48 xterms or emacs windows side by side
> on my monitor with a nice big clear easy to read font.  Itty bitty

That's pretty much what I do.  For me at least, it's a more efficient
use of screen real estate, and of course the overwhelming majority of
source code looks great in an 80-column text window.

	Jeff




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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  1:47     ` Jeff Garzik
@ 2007-06-08  1:56       ` John Stoffel
  2007-06-08  2:07         ` Jeff Garzik
  2007-06-09 20:41         ` Krzysztof Halasa
  0 siblings, 2 replies; 23+ messages in thread
From: John Stoffel @ 2007-06-08  1:56 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: John Stoffel, Krzysztof Halasa, Alan Cox, akpm, linux-kernel


Jeff> On Thu, Jun 07, 2007 at 09:44:57PM -0400, John Stoffel wrote:
>> I don't.  I use a pair of 80x48 xterms or emacs windows side by side
>> on my monitor with a nice big clear easy to read font.  Itty bitty

Jeff> That's pretty much what I do.  For me at least, it's a more
Jeff> efficient use of screen real estate, and of course the
Jeff> overwhelming majority of source code looks great in an 80-column
Jeff> text window.

Thinking about it more, I wonder if Krysztof is bitching more about
the tab width of 8 characters?   I know that it ticks me off,
indenting by two spaces is plenty for me to follow the flow, along
with Emacs and braces closure indication.  

I'm constantly un-tabifying code and making my indents be just two
spaces, though I guess I should really just change my tab-width to be
2 consistently.

What do you think Krysztof?

John

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  1:56       ` John Stoffel
@ 2007-06-08  2:07         ` Jeff Garzik
  2007-06-08  2:11           ` John Stoffel
  2007-06-09 20:41         ` Krzysztof Halasa
  1 sibling, 1 reply; 23+ messages in thread
From: Jeff Garzik @ 2007-06-08  2:07 UTC (permalink / raw)
  To: John Stoffel; +Cc: Krzysztof Halasa, Alan Cox, akpm, linux-kernel

On Thu, Jun 07, 2007 at 09:56:06PM -0400, John Stoffel wrote:
> Thinking about it more, I wonder if Krysztof is bitching more about
> the tab width of 8 characters?   I know that it ticks me off,

Even if he is, _that_ is definitely not getting changed.

That was the very first item Linus wrote in Documentation/CodingStyle,
and for good reasons.

If code starts creeping way right due to indentation levels, create a
new function.

	Jeff




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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  2:07         ` Jeff Garzik
@ 2007-06-08  2:11           ` John Stoffel
  2007-06-08 18:21             ` Ingo Oeser
  0 siblings, 1 reply; 23+ messages in thread
From: John Stoffel @ 2007-06-08  2:11 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: John Stoffel, Krzysztof Halasa, Alan Cox, akpm, linux-kernel


Jeff> On Thu, Jun 07, 2007 at 09:56:06PM -0400, John Stoffel wrote:
>> Thinking about it more, I wonder if Krysztof is bitching more about
>> the tab width of 8 characters?   I know that it ticks me off,

Jeff> Even if he is, _that_ is definitely not getting changed.

Oh sure... I know that part is written in stone.  

Jeff> That was the very first item Linus wrote in
Jeff> Documentation/CodingStyle, and for good reasons.

I could argue that 4 spaces would be a better level, but it's a
personal preference and not worth the battle.  

Jeff> If code starts creeping way right due to indentation levels,
Jeff> create a new function.

Sure... compilers are good, us humans haven't gotten much better, make
it easier on us and harder on the computer.   

John

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  1:25         ` Jeff Garzik
@ 2007-06-08 10:11           ` Peter Zijlstra
  2007-06-09 20:33             ` Krzysztof Halasa
  0 siblings, 1 reply; 23+ messages in thread
From: Peter Zijlstra @ 2007-06-08 10:11 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: H. Peter Anvin, Krzysztof Halasa, Alistair John Strachan,
	Alan Cox, akpm, linux-kernel

On Thu, 2007-06-07 at 21:25 -0400, Jeff Garzik wrote:
> On Thu, Jun 07, 2007 at 06:08:32PM -0700, H. Peter Anvin wrote:
> > My big concern with the 80-column rule is that it discourages commenting.
> 
> My concern with that logic is that encourages random, super-wide code
> lines that varies with each coder.  You are left to the mercy of he with
> the widest text window.

I just counted, I can get 380 chars on 1 screen, if I let it straddle
the two monitors I have then I can get 760 chars.

> The 80-column rule is good as a general guideline, though there are
> obvious exceptions.  Comments IMO are not one of them.  That rapidly
> creates unreadable code.

I agree, its easier on the eyes to have dense columns of text to read
than having to scan all over the place. More so, its more economical of
screen-estate as well, a few long lines take up valuable space which
could otherwise have been used to create more columns (yes, from the guy
sitting behind the two 24" screen).

I usually work with 4 columns side by side per screen, that gives me
about 92x110 columns. Its easy on they eye (it need not wander all over
the place to read stuff) and it can handle the occasional line that
exceeds 80 chars (they never exceed very far - yes there are
exceptions :-( )




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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  2:11           ` John Stoffel
@ 2007-06-08 18:21             ` Ingo Oeser
  0 siblings, 0 replies; 23+ messages in thread
From: Ingo Oeser @ 2007-06-08 18:21 UTC (permalink / raw)
  To: John Stoffel; +Cc: Jeff Garzik, Krzysztof Halasa, Alan Cox, akpm, linux-kernel

On Friday 08 June 2007, John Stoffel wrote:
> Jeff> On Thu, Jun 07, 2007 at 09:56:06PM -0400, John Stoffel wrote:
> >> Thinking about it more, I wonder if Krysztof is bitching more about
> >> the tab width of 8 characters?   I know that it ticks me off,
> 
> Jeff> Even if he is, _that_ is definitely not getting changed.
> 
> Oh sure... I know that part is written in stone.  

Yes, and as a person doing Linux code review for 12 years now,
I'm really thankful for it. 8 char tab, 80 column rule and 25-50 lines
of code per function actually enable effective review of code snippets.
Because you can see more code flow per patch.

And enables high code reuse. If you can get within 1-5min, 
what a functions does and match it with your actually 
written down last 20 code lines, you just reuse it more often.

If you have more to choose from, you reuse naturally. 
Personally I find best candidates by code position in tree and 
function signature.

> Jeff> If code starts creeping way right due to indentation levels,
> Jeff> create a new function.
> 
> Sure... compilers are good, us humans haven't gotten much better, make
> it easier on us and harder on the computer.   

Yes, let compile remove all the abstraction overhead. 
GCC does a pretty good job there, I think.

I recently analyzed some code and it took much, much longer (factor 2-3), 
because of laxer coding rules similiar to the ones you suggest.

I even asked the developers, who wrote that code and to ones who work 
daily with that code base and they had the same problems. They all couldn't 
explain the "Why?" only the "How?". Not to mention, that this was a core 
component.

After refactoring some big messy parts into smaller functions,
identical, missing, unhandled cases became visible, inappropriate usages
were identified and even some loops could be removed.

Now try to find such problems within Linux. They should be a small percentage 
and not within core components.

So a big THANKS to all the code cops here: You actually make the 
	damn fast change rate of Linux possible by keeping the base clean 
	and neat.

Best Regards

Ingo oeser

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08 10:11           ` Peter Zijlstra
@ 2007-06-09 20:33             ` Krzysztof Halasa
  0 siblings, 0 replies; 23+ messages in thread
From: Krzysztof Halasa @ 2007-06-09 20:33 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Jeff Garzik, H. Peter Anvin, Alistair John Strachan, Alan Cox,
	akpm, linux-kernel

Peter Zijlstra <peterz@infradead.org> writes:

> I agree, its easier on the eyes to have dense columns of text to read
> than having to scan all over the place.

Sure, though I don't propose writing 130 chars in each line. Tabs
don't need much scanning.
-- 
Krzysztof Halasa

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

* Re: [PATCH] intel-rng: Undo mess made by an 80 column extremist
  2007-06-08  1:56       ` John Stoffel
  2007-06-08  2:07         ` Jeff Garzik
@ 2007-06-09 20:41         ` Krzysztof Halasa
  1 sibling, 0 replies; 23+ messages in thread
From: Krzysztof Halasa @ 2007-06-09 20:41 UTC (permalink / raw)
  To: John Stoffel; +Cc: Jeff Garzik, Alan Cox, akpm, linux-kernel

"John Stoffel" <john@stoffel.org> writes:

> Thinking about it more, I wonder if Krysztof is bitching more about
> the tab width of 8 characters?   I know that it ticks me off,
> indenting by two spaces is plenty for me to follow the flow, along
> with Emacs and braces closure indication.

Well, 8 might be too long but I wouldn't be able to read the code
with 2-chars tabs. Even on a large wall display.

4 chars, maybe, but I'm not sure. 8 chars is great except that the
lines are too short.

Obviously it's the space taken by indentation, the "real" line
length of ~ 70 chars (such as in this msg) is ok.
-- 
Krzysztof Halasa

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

end of thread, other threads:[~2007-06-09 20:41 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-07 15:22 [PATCH] intel-rng: Undo mess made by an 80 column extremist Alan Cox
2007-06-07 15:23 ` Jeff Garzik
2007-06-07 15:44   ` Alan Cox
2007-06-07 17:22     ` Jeff Garzik
2007-06-07 21:17 ` Krzysztof Halasa
2007-06-07 21:32   ` Alistair John Strachan
2007-06-07 22:06     ` Krzysztof Halasa
2007-06-08  1:08       ` H. Peter Anvin
2007-06-08  1:25         ` Jeff Garzik
2007-06-08 10:11           ` Peter Zijlstra
2007-06-09 20:33             ` Krzysztof Halasa
2007-06-07 22:32   ` Daniel Hazelton
2007-06-07 22:37     ` Krzysztof Halasa
2007-06-07 23:01       ` Daniel Hazelton
2007-06-07 22:46     ` Jesper Juhl
2007-06-07 23:04       ` Daniel Hazelton
2007-06-08  1:44   ` John Stoffel
2007-06-08  1:47     ` Jeff Garzik
2007-06-08  1:56       ` John Stoffel
2007-06-08  2:07         ` Jeff Garzik
2007-06-08  2:11           ` John Stoffel
2007-06-08 18:21             ` Ingo Oeser
2007-06-09 20:41         ` Krzysztof Halasa

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