logo
Published on KernelTrap (http://kerneltrap.org)

White Space

By Jeremy
Created Sep 22 2007 - 05:22

Matt LaPlante reported [1] that there's currently 151,809 bytes of trailing white space in the Linux kernel, requiring a 15 megabyte patch to remove it all. Andi Kleen argued that the white space didn't much matter, "you don't actually save anything on disk on most file systems (essentially everything except reiserfs on current Linux) because all files are rounded to block size (normally 4K). Same in page cache. And in tar files bzip2/gzip is very good at compacting them."

Andi went on to add that it's an issue that is slowly solving itself, "many kernel maintainers automatically remove trailing white space on any new lines these days. So as the kernel keeps changing it should eventually all disappear; except on essentially dead code." Pádraig Brady confirmed that things are naturally improving over time, as a similar report in 2001 found 224,654 bytes of trailing whitespace in the Linux kernel.


From: Matt LaPlante <kernel1@...>
Subject: A little coding style nugget of joy
 [1]Date: Sep 19, 12:34 pm 2007

Since everyone loves random statistics, here are a few gems to give you a break from your busy day:

Number of lines in the 2.6.22 Linux kernel source that include one or more trailing whitespaces: 135209
Bytes saved by removing said whitespace: 151809
Lines in the (unified) diff: 455437
Size of the diff: 15M
People brave enough to submit the patch: ~0

Take care. :)

-
Matt
-

From: Andi Kleen <andi@...> Subject: Re: A little coding style nugget of joy [1]Date: Sep 19, 1:13 pm 2007 Matt LaPlante <kernel1@cyberdogtech.com> writes: > Since everyone loves random statistics, here are a few gems to give you a break from your busy day: > > Number of lines in the 2.6.22 Linux kernel source that include one or more trailing whitespaces: 135209 > Bytes saved by removing said whitespace: 151809 You don't actually save anything on disk on most file systems (essentially everything except reiserfs on current Linux) because all files are rounded to block size (normally 4K) Same in page cache. And in tar files bzip2/gzip is very good at compacting them. > Lines in the (unified) diff: 455437 > Size of the diff: 15M > People brave enough to submit the patch: ~0 Many kernel maintainers automatically remove trailing white space on any new lines these days. So as the kernel keeps changing it should eventually all disappear; except on essentially dead code. -Andi -
From: Pádraig Brady <P@...> Subject: Re: A little coding style nugget of joy [1]Date: Sep 20, 5:20 am 2007 Matt LaPlante wrote: > Since everyone loves random statistics, here are a few gems to give you a break from your busy day: > > Number of lines in the 2.6.22 Linux kernel source that include one or more trailing whitespaces: 135209 > Bytes saved by removing said whitespace: 151809 > Lines in the (unified) diff: 455437 > Size of the diff: 15M > People brave enough to submit the patch: ~0 It's gradually getting better so: http://lwn.net/2001/1129/a/whitespace.php3 [2] -


Related links:


Source URL:
http://kerneltrap.org/Linux/White_Space