Re: A little coding style nugget of joy

From: Andi Kleen
Date: Wed Sep 19 2007 - 13:14:09 EST


Matt LaPlante <kernel1@xxxxxxxxxxxxxxxx> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/