aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/CodingStyle
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2013-07-03 18:08:08 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:08:01 -0400
commitb57a0505e750b3d7b2d39e9823b276d8ca1a08fe (patch)
tree36dc1bdf810168a3509861fd3a0c61ca562ec272 /Documentation/CodingStyle
parente68e96d2a7b2391cc1f70e207ec9cbe9d092adc9 (diff)
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@oracle.com> Cc: Eduardo Valentin <eduardo.valentin@ti.com> Cc: Rob Landley <rob@landley.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation/CodingStyle')
-rw-r--r--Documentation/CodingStyle3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index e00b8f0dde52..7fe0546c504a 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -389,7 +389,8 @@ Albeit deprecated by some people, the equivalent of the goto statement is
389used frequently by compilers in form of the unconditional jump instruction. 389used frequently by compilers in form of the unconditional jump instruction.
390 390
391The goto statement comes in handy when a function exits from multiple 391The goto statement comes in handy when a function exits from multiple
392locations and some common work such as cleanup has to be done. 392locations and some common work such as cleanup has to be done. If there is no
393cleanup needed then just return directly.
393 394
394The rationale is: 395The rationale is:
395 396