Re: Newer Patch: CPU-detection for older processors (<586)

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Mon, 27 Sep 1999 14:23:19 +0200 (MEST)


David Weinehall wrote:
> On Mon, 27 Sep 1999, Rogier Wolff wrote:
>
> > David Weinehall wrote:
> > >
> > > Oh, and there's quite a lot of slack spaces and a few ^M (that is, DOS
> > > linebreaks), could you remove them? I'm being nitpicky now, but why have
> > > 8 spaces when you can have one tab...
> >
> > I disagree with the "nitpicky" part. This is not nitpicky.
> >
> > Really, it's MUCH better to have the tabs/spaces thing right. It means
> > that the source formats OK for people with tabspacing=4 too.
> >
> > if (...) {
> > printk (KERN_WARN "This is a test. %d %d %d\n",
> > info->a, info->b, info->c);
> > }
> >
> > Note that there are two tabs before the "printk", as well as the next
> > line. Here with the tabspacing at 8, one extra tab could be used
> > before the info->a, but that would mess up if you have the tabspacing
> > at anything else than 8. So there is two tabs and 8 spaces before the
> > "info->a" line.
>
> Of course, a tab is a tab is a tab, and a tab is 8, NOT 4... Have a look
> in Documentation/CodingStyle

(which says tabs are always 8 chars)

I always have my tabs at 8. People who choose to use a different
tabsize are able to read my sources without any ill effects. It costs
an occasional few bytes (as in the example above), but makes the
sources read much better (also under different circumstances).

If you assume "tabs-are-8" and allow yourself to work from that, it is
allowed to start a line with 8 spaces too. Which looks bad in patches:

a += 2;
b += 2;
+ c += 2;
d += 2;
e += 2;

Note patch's two spaces at the beginning of every line with a tab
behind it. The "added" line ("c += 2;") has 8 spaces (and "+ " from
patch).

I recommend that everyone be as careful as possible about spaces/tabs.
A small effort if split among all kernel programmers.

Roger.

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/