[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <B5657A6538887040AD3A81F1008BEC63B31D99@avmb3.qlogic.org>
Date: Thu, 4 Sep 2014 07:58:32 +0000
From: Yuval Mintz <Yuval.Mintz@...gic.com>
To: Ian Morris <ipm@...rality.org.uk>,
YOSHIFUJI Hideaki/吉藤英明
<hideaki.yoshifuji@...aclelinux.com>,
netdev <netdev@...r.kernel.org>
CC: YOSHIFUJI Hideaki <yoshfuji@...ux-ipv6.org>
Subject: RE: [PATCH net-next 4/4] ipv6: coding style - cleanse bracing
> >> Ian Morris wrote:
> >>> Tidy up braces in a few places (mainly if statements):
> >>> * remove unnecessary braces
> >>> * add braces for single line statements where part of an "else"
> >>> where the other branch has braces
> >> Hmm, I am not for this change.
> >>
> >> If "if" (or "else") statement occupies multiple lines, I want to see
> >> braces even if it contains a single statement.
> >> On the other hand, especiallly if the statement occupiles only one
> >> line (and the logic do not require those braces), no braces.
> >>
> >> e.g. 1
> >> if (cond)
> >> statement();
> >> else {
> >> statement2(argument,
> >> argument2);
> >> }
> > I was under the impression the coding style require matching curly
> > braces on all if and else clauses, e.g., in the previous example I
> > would have expected the `if' to have curly braces since its else block
> > has them, regardless of whether its statement-block has more than a single
> line.
> Indeed, this was my understanding which is why the patch is mostly the way it is.
> I suppose if netdev can have its own approach for comments, there's no reason
> not to have a netdev approach for if...else patterns also but presently things are
> a little inconsistent in the ipv6 code unfortunately so some work will be required
> either way.
True, but I've never noticed we had this suggested approach to comments in netdev.
> >> e.g. 2
> >> if (cond) {
> >> if (cond2)
> >> statement();
> >> } else
> >> statement2(argument, argument2);
> >>
> >> e.g. 3
> >> if (cond) {
> >> /* comment */
> >> statement();
> >> }
________________________________
This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
--
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