Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1199196

Re: [PATCH] sata_sx4: Check return code from pdc20621_i2c_read()

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] sata_sx4: Check return code from pdc20621_i2c_read()
Date 2015-08-03 21:10 +0200
Message-ID <pTthx-3DC-21@gated-at.bofh.it> (permalink)
References <pTqjG-7A6-55@gated-at.bofh.it> <pTsY9-31v-17@gated-at.bofh.it> <pTt7R-3cQ-21@gated-at.bofh.it> <pTthx-3DC-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, 2015-08-03 at 12:04 -0700, Tomer Barletz wrote:
> I see how it makes sense to add a tab to align with the previous line
> of code, as it will always look similar in all editors, no matter how
> their tab character is set up to be.
> However, adding more tabs will just mess up editors that are not set
> up with 8-space width tabs.
> 
> Is this a bug in checkpatch.pl, or are we saying everyone should have
> their editor set to 8-spaces width tabs?

from Documentation/CodingStyle:

		Chapter 1: Indentation

Tabs are 8 characters, and thus indentations are also 8 characters.
There are heretic movements that try to make indentations 4 (or even 2!)
characters deep, and that is akin to trying to define the value of PI to
be 3.

Rationale: The whole idea behind indentation is to clearly define where
a block of control starts and ends.  Especially when you've been looking
at your screen for 20 straight hours, you'll find it a lot easier to see
how the indentation works if you have large indentations.

Now, some people will claim that having 8-character indentations makes
the code move too far to the right, and makes it hard to read on a
80-character terminal screen.  The answer to that is that if you need
more than 3 levels of indentation, you're screwed anyway, and should fix
your program.

In short, 8-char indents make things easier to read, and have the added
benefit of warning you when you're nesting your functions too deep.
Heed that warning.

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] Check return code from pdc20621_i2c_read() Tomer Barletz <barletz@gmail.com> - 2015-08-02 12:20 +0200
  Re: [PATCH] Check return code from pdc20621_i2c_read() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-08-02 13:10 +0200
    Re: [PATCH] Check return code from pdc20621_i2c_read() Joe Perches <joe@perches.com> - 2015-08-02 20:10 +0200
    Re: [PATCH] Check return code from pdc20621_i2c_read() Tomer Barletz <barletz@gmail.com> - 2015-08-02 20:00 +0200
      Re: [PATCH] Check return code from pdc20621_i2c_read() Joe Perches <joe@perches.com> - 2015-08-02 22:30 +0200
      Re: [PATCH] Check return code from pdc20621_i2c_read() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-08-03 17:50 +0200
        Re: [PATCH] Check return code from pdc20621_i2c_read() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-08-03 18:00 +0200
          [PATCH] sata_sx4: Check return code from pdc20621_i2c_read() Tomer Barletz <barletz@gmail.com> - 2015-08-03 20:50 +0200
            Re: [PATCH] sata_sx4: Check return code from pdc20621_i2c_read() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-08-03 21:00 +0200
              Re: [PATCH] sata_sx4: Check return code from pdc20621_i2c_read() Joe Perches <joe@perches.com> - 2015-08-03 21:10 +0200
              Re: [PATCH] sata_sx4: Check return code from pdc20621_i2c_read() Tomer Barletz <barletz@gmail.com> - 2015-08-03 21:10 +0200
                Re: [PATCH] sata_sx4: Check return code from pdc20621_i2c_read() Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2015-08-03 21:20 +0200
              [PATCH] sata_sx4: Check return code from pdc20621_i2c_read() Tomer Barletz <barletz@gmail.com> - 2015-08-03 21:20 +0200

csiph-web