+ documentation-codingstyle-allow-multiple-return-statements-per-function.patch added to -mm tree

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

 



Subject: + documentation-codingstyle-allow-multiple-return-statements-per-function.patch added to -mm tree
To: dan.carpenter@xxxxxxxxxx,eduardo.valentin@xxxxxx,rob@xxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Mon, 20 May 2013 13:05:08 -0700


The patch titled
     Subject: Documentation/CodingStyle: allow multiple return statements per function
has been added to the -mm tree.  Its filename is
     documentation-codingstyle-allow-multiple-return-statements-per-function.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 ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Subject: Documentation/CodingStyle: allow multiple return statements per function

A surprising number of newbies interpret this section to mean that only
one return statement is allowed per function.  Part of the problem is that
the "one return statement per function" rule is an actual style guideline
that people are used to from other projects.

Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Cc: Eduardo Valentin <eduardo.valentin@xxxxxx>
Cc: Rob Landley <rob@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 Documentation/CodingStyle |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN Documentation/CodingStyle~documentation-codingstyle-allow-multiple-return-statements-per-function Documentation/CodingStyle
--- a/Documentation/CodingStyle~documentation-codingstyle-allow-multiple-return-statements-per-function
+++ a/Documentation/CodingStyle
@@ -389,7 +389,8 @@ Albeit deprecated by some people, the eq
 used frequently by compilers in form of the unconditional jump instruction.
 
 The goto statement comes in handy when a function exits from multiple
-locations and some common work such as cleanup has to be done.
+locations and some common work such as cleanup has to be done.  If there is no
+cleanup needed then just return directly.
 
 The rationale is:
 
_

Patches currently in -mm which might be from dan.carpenter@xxxxxxxxxx are

origin.patch
linux-next.patch
configfs-use-capped-length-for-store_attribute.patch
errh-is_err-can-accept-__user-pointers.patch
rbtree-remove-unneeded-include.patch
documentation-codingstyle-allow-multiple-return-statements-per-function.patch
mwave-fix-info-leak-in-mwave_ioctl.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




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux