[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B08D967.80003@gmail.com>
Date: Sun, 22 Nov 2009 01:25:43 -0500
From: William Allen Simpson <william.allen.simpson@...il.com>
To: David Miller <davem@...emloft.net>
CC: netdev@...r.kernel.org
Subject: Re: [net-next-2.6 PATCH v7 5/7 RFC] TCPCT part 1e: implement socket
option TCP_COOKIE_TRANSACTIONS
David Miller wrote:
> From: William Allen Simpson <william.allen.simpson@...il.com>
> Date: Fri, 20 Nov 2009 09:48:12 -0500
>> + if (ctd.tcpct_used > 0
>> + || (tp->cookie_values == NULL
>> + && (sysctl_tcp_cookie_size > 0
>> + || ctd.tcpct_cookie_desired > 0
>> + || ctd.tcpct_s_data_desired > 0))) {
>
> Please fix the conditional coding style, and the alignment of
> the lines, it's not right here.
>
Eliding the repeated assertions, and focusing on this example.
This is not addressed (nor forbidden) in CodingStyle.
As Joe noted earlier with '?' and ':', there are ample examples
throughout the code base of this style, including here and there
among the tcp*.c files. Obviously, this is very easy to read!
Coding style is all about readability and maintainability
using commonly available tools.
However, grep shows that the "||" or "&&" is elsewhere most often
indented 4 for each level (although there is some inconsistency).
Either 1, 2, or 4 distinguishes <condition> indentation from
<statements> indented by tab (8).
In my experience, I've found 1 best, as that lines up variables
and parentheses levels, and it's easy to type. But it certainly
would be easy enough to indent by 2 or 4 instead.
BTW, the 'indent' program turns this into incomprehensible and
unmaintainable garbage. Of course, there are ample examples of
garbage in these tcp*.c files, too.... :-(
Therefore, David, would indentation of 2 or 4 be preferable here?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists