Re: coding style for long conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/6/07, Roland Dreier <[email protected]> wrote:
[I can't believe I'm stepping into an indentation flamewar, but here goes...]

that the line with "bar" on it is properly indented with one tab
(since it is part of the if statement that is also indented one tab),
and then four spaces are used to align the "bar" with the previous
line.  So only tabs are used for indentation, and the spaces after the
tab are used for alignment, and the letter of the law is observed.

If you have a git tree handy, you can do "git show 68380b58" and see
that Linus himself wrote:

        if (get_wq_data(work) == cwq
            && work_pending(work)
            && !list_empty(&work->entry)) {

---

I'm happy to see Linus did it exactly the way I would have...

So, perhaps the rule in CodingStyle should be clarified to say that
indentation is used to show nesting depth and always expressed in TAB
characters, but additional spacing may be used following the
structural TABs to appropriately format continuation lines...

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux