The patch titled Documentation/CodingStyle: flesh out if-else examples has been added to the -mm tree. Its filename is documentation-codingstyle-flesh-out-if-else-examples.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: Documentation/CodingStyle: flesh out if-else examples From: Harry Wei <jiaweiwei.xiyou@xxxxxxxxx> There is a missing case for "Chapter 3: Placing Braces and Spaces". We often know we should not use braces where a single statement. The first case is: if (condition) action(); Another case is: if (condition) do_this(); else do_that(); However, I can not find a description of the second case. Signed-off-by: Harry Wei <harryxiyou@xxxxxxxxx> Cc: Randy Dunlap <randy.dunlap@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- Documentation/CodingStyle | 7 +++++++ 1 file changed, 7 insertions(+) diff -puN Documentation/CodingStyle~documentation-codingstyle-flesh-out-if-else-examples Documentation/CodingStyle --- a/Documentation/CodingStyle~documentation-codingstyle-flesh-out-if-else-examples +++ a/Documentation/CodingStyle @@ -168,6 +168,13 @@ Do not unnecessarily use braces where a if (condition) action(); +and + +if (condition) + do_this(); +else + do_that(); + This does not apply if one branch of a conditional statement is a single statement. Use braces in both branches. _ Patches currently in -mm which might be from jiaweiwei.xiyou@xxxxxxxxx are linux-next.patch maintainers-add-chinese-documentation-maintainer.patch maintainers-add-topgit-for-t.patch documentation-codingstyle-flesh-out-if-else-examples.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html