2004-01-27 15:45:08

by Rui Saraiva

[permalink] [raw]
Subject: RFC: Trailing blanks in source files

Hello,

It seems that many files [1] in the Linux source have lines with
trailing blank (space and tab) characters and some even have formfeed
characters. Obviously these blank characters aren't necessary.

I wonder if it is a waste of time to send patches that clean the
source? Those patches will only remove those trailing blank characters and
will be splitted by maintainer.


Regards,
Rui Saraiva


[1]
> grep -lR "[[:blank:]]$" /usr/src/linux/ | wc -l
8163


2004-01-27 16:14:59

by YOSHIFUJI Hideaki

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

In article <[email protected]> (at Tue, 27 Jan 2004 15:44:56 +0000 (WET)), Rui Saraiva <[email protected]> says:

> It seems that many files [1] in the Linux source have lines with
> trailing blank (space and tab) characters and some even have formfeed
> characters. Obviously these blank characters aren't necessary.

I do not like to change this if it is done blindly.

--
Hideaki YOSHIFUJI @ USAGI Project <[email protected]>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA

2004-01-27 16:28:57

by Bas Mevissen

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

YOSHIFUJI Hideaki / ???? wrote:
> In article <[email protected]> (at Tue, 27 Jan 2004 15:44:56 +0000 (WET)), Rui Saraiva <[email protected]> says:
>
>
>> It seems that many files [1] in the Linux source have lines with
>>trailing blank (space and tab) characters and some even have formfeed
>>characters. Obviously these blank characters aren't necessary.
>
>
> I do not like to change this if it is done blindly.
>

Agree. But if you compile a allconfigyes kernel before and after and
they appear to be binary equal, we know we are pretty safe :-)


Regards,

Bas.

2004-01-27 18:36:55

by Andi Kleen

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

Rui Saraiva <[email protected]> writes:

> It seems that many files [1] in the Linux source have lines with
> trailing blank (space and tab) characters and some even have formfeed
> characters. Obviously these blank characters aren't necessary.
>
> I wonder if it is a waste of time to send patches that clean the
> source? Those patches will only remove those trailing blank characters and
> will be splitted by maintainer.

A lot of people will hate you for that because you'll break their external
patches without any good reason.

Don't do it.

I'm sure there are lots of other areas where good clean up can be done
without causing problems.

-Andi

2004-01-27 18:52:39

by Joseph D. Wagner

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

> It seems that many files [1] in the Linux source have lines with
> trailing blank (space and tab) characters and some even have formfeed
> characters. Obviously these blank characters aren't necessary.

Actually, they are necessary.

http://www.gnu.org/prep/standards_23.html
http://www.gnu.org/prep/standards_24.html

2004-01-27 19:14:15

by David Weinehall

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

On Tue, Jan 27, 2004 at 12:51:34PM -0600, Joseph D. Wagner wrote:
> > It seems that many files [1] in the Linux source have lines with
> > trailing blank (space and tab) characters and some even have formfeed
> > characters. Obviously these blank characters aren't necessary.
>
> Actually, they are necessary.
>
> http://www.gnu.org/prep/standards_23.html
> http://www.gnu.org/prep/standards_24.html

Let me quote CodingStyle:

"First off, I'd suggest printing out a copy of the GNU coding standards,
and NOT read it. Burn them, it's a great symbolic gesture."

That's how much relevance GNU's coding standards have to the kernel.


Regards: David Weinehall
--
/) David Weinehall <[email protected]> /) Northern lights wander (\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\) http://www.acc.umu.se/~tao/ (/ Full colour fire (/

2004-01-27 19:19:28

by linux

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

On Tue, Jan 27, 2004 at 12:51:34PM -0600, Joseph D. Wagner wrote:
> > It seems that many files [1] in the Linux source have lines with
> > trailing blank (space and tab) characters and some even have formfeed
> > characters. Obviously these blank characters aren't necessary.
>
> Actually, they are necessary.
>
> http://www.gnu.org/prep/standards_23.html
> http://www.gnu.org/prep/standards_24.html

>From Documentation/CodingStyle:

| First off, I'd suggest printing out a copy of the GNU coding standards,
| and NOT read it. Burn them, it's a great symbolic gesture.

2004-01-27 19:23:35

by Randy.Dunlap

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

On Tue, 27 Jan 2004 20:13:58 +0100 David Weinehall <[email protected]> wrote:

| On Tue, Jan 27, 2004 at 12:51:34PM -0600, Joseph D. Wagner wrote:
| > > It seems that many files [1] in the Linux source have lines with
| > > trailing blank (space and tab) characters and some even have formfeed
| > > characters. Obviously these blank characters aren't necessary.
| >
| > Actually, they are necessary.
| >
| > http://www.gnu.org/prep/standards_23.html
| > http://www.gnu.org/prep/standards_24.html
|
| Let me quote CodingStyle:
|
| "First off, I'd suggest printing out a copy of the GNU coding standards,
| and NOT read it. Burn them, it's a great symbolic gesture."
|
| That's how much relevance GNU's coding standards have to the kernel.

Thank you, I had forgotten that one and I was wondering what the
heck those web pages had to do with anything (kernel).

So please don't bother with just whitespace changes unless you
are going to cleanup a <driver | fs | module | etc> completely.

--
~Randy
kernel-janitors project: http://janitor.kernelnewbies.org/

2004-01-27 19:36:58

by Paulo Marques

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

David Weinehall wrote:

> On Tue, Jan 27, 2004 at 12:51:34PM -0600, Joseph D. Wagner wrote:
>
>>>It seems that many files [1] in the Linux source have lines with
>>>trailing blank (space and tab) characters and some even have formfeed
>>>characters. Obviously these blank characters aren't necessary.
>>>
>>Actually, they are necessary.
>>
>>http://www.gnu.org/prep/standards_23.html
>>http://www.gnu.org/prep/standards_24.html
>>
>
> Let me quote CodingStyle:
>
> "First off, I'd suggest printing out a copy of the GNU coding standards,
> and NOT read it. Burn them, it's a great symbolic gesture."
>
> That's how much relevance GNU's coding standards have to the kernel.
>

And even if we did use GNU's coding standards (knock on wood :), where is the
part that requires *trailing* spaces?

Only in languages like "whitespace" ( http://compsoc.dur.ac.uk/whitespace/ ) the
trailing spaces have any meaning :)

--
Paulo Marques - http://www.grupopie.com
"In a world without walls and fences who needs windows and gates?"

2004-01-28 00:00:58

by Andrew Morton

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

"Randy.Dunlap" <[email protected]> wrote:
>
> So please don't bother with just whitespace changes unless you
> are going to cleanup a <driver | fs | module | etc> completely.

And if you're going to do that, do the whitespace cleanup _first_, so the
substantive changes to the driver/fs/module/etc can be sanely understood
and reverted if necessary.

I frequently sneakily remove all newly-added trailing whitespace from the
patches people send me. In 15 years it'll all be gone.

2004-01-28 03:49:48

by jw schultz

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

On Tue, Jan 27, 2004 at 04:02:14PM -0800, Andrew Morton wrote:
> "Randy.Dunlap" <[email protected]> wrote:
> >
> > So please don't bother with just whitespace changes unless you
> > are going to cleanup a <driver | fs | module | etc> completely.
>
> And if you're going to do that, do the whitespace cleanup _first_, so the
> substantive changes to the driver/fs/module/etc can be sanely understood
> and reverted if necessary.
>
> I frequently sneakily remove all newly-added trailing whitespace from the
> patches people send me. In 15 years it'll all be gone.

This would maybe warrant a bk option to remove trailing
whitespace from modified lines. Preferably with an
notification that it is happening so if for some reason you
do want trailing whitespace you could abort or override.

A patch filter that removed trailing whitespace from + lines
could also be used.

--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: [email protected]

Remember Cernan and Schmitt

2004-01-28 03:58:13

by Randy.Dunlap

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

On Tue, 27 Jan 2004 19:49:39 -0800 jw schultz <[email protected]> wrote:

| On Tue, Jan 27, 2004 at 04:02:14PM -0800, Andrew Morton wrote:
| > "Randy.Dunlap" <[email protected]> wrote:
| > >
| > > So please don't bother with just whitespace changes unless you
| > > are going to cleanup a <driver | fs | module | etc> completely.
| >
| > And if you're going to do that, do the whitespace cleanup _first_, so the
| > substantive changes to the driver/fs/module/etc can be sanely understood
| > and reverted if necessary.
| >
| > I frequently sneakily remove all newly-added trailing whitespace from the
| > patches people send me. In 15 years it'll all be gone.
|
| This would maybe warrant a bk option to remove trailing
| whitespace from modified lines. Preferably with an
| notification that it is happening so if for some reason you
| do want trailing whitespace you could abort or override.
|
| A patch filter that removed trailing whitespace from + lines
| could also be used.

AFAIK Andrew already uses a script to check for trailing spaces,
and I do also. Yes, it could be modified to be a conversion filter,
but it doesn't happen frequently, and when it does, I want to let
the poster know about it, so I like to have the evidence handy. :)

--
~Randy

2004-01-28 04:53:52

by Pragnesh Sampat

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

> | > I frequently sneakily remove all newly-added trailing whitespace from the
> | > patches people send me. In 15 years it'll all be gone.
> |
> | This would maybe warrant a bk option to remove trailing
> | whitespace from modified lines. Preferably with an
> | notification that it is happening so if for some reason you
> | do want trailing whitespace you could abort or override.
> |
> | A patch filter that removed trailing whitespace from + lines
> | could also be used.
>
> AFAIK Andrew already uses a script to check for trailing spaces,
> and I do also. Yes, it could be modified to be a conversion filter,
> but it doesn't happen frequently, and when it does, I want to let
> the poster know about it, so I like to have the evidence handy. :)

Recent versions of emacs, for those that use it, have whitespace.el (for
cleaning up as you go along). It can cleanup different kinds of
whitespace based on settings. Check C-h f whitespace-describe for more
details. Got used to that heavily at one point, these days I am kind of
neutral, sometimes I do it, sometimes I don't bother.

-Pragnesh

2004-01-28 22:16:09

by Paul Jackson

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

Joseph D. Wagner
> Actually, they are necessary.

Paulo Marques
> where is the part that requires *trailing* spaces?

No where. Joseph was ambiguous - I'd guess he meant:
Actually, formfeeds are necessary.

--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <[email protected]> 1.650.933.1373

2004-01-28 22:22:18

by David Weinehall

[permalink] [raw]
Subject: Re: RFC: Trailing blanks in source files

On Wed, Jan 28, 2004 at 02:15:40PM -0800, Paul Jackson wrote:
> Joseph D. Wagner
> > Actually, they are necessary.
>
> Paulo Marques
> > where is the part that requires *trailing* spaces?
>
> No where. Joseph was ambiguous - I'd guess he meant:
> Actually, formfeeds are necessary.

Which is of course not the case either...


Regards: David Weinehall
--
/) David Weinehall <[email protected]> /) Northern lights wander (\
// Maintainer of the v2.0 kernel // Dance across the winter sky //
\) http://www.acc.umu.se/~tao/ (/ Full colour fire (/