summaryrefslogtreecommitdiffstats
path: root/Documentation/CodingStyle
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2016-09-21 17:46:18 -0400
committerJonathan Corbet <corbet@lwn.net>2016-09-21 17:53:31 -0400
commit79c70c304b0b443429b2a0019518532c5162817a (patch)
treee889f6002f16f6299ce07e7274990d64ce2a24ec /Documentation/CodingStyle
parentdca22a63fd036c3ebb50212060eba0080f178126 (diff)
docs: Remove space-before-label guidance from CodingStyle
Recent discussion has made it clear that there is no community consensus on this particular rule. Remove it now, lest it inspire yet another set of unwanted "cleanup" patches. This partially reverts 865a1caa4b6b (CodingStyle: Clarify and complete chapter 7). Cc: Jean Delvare <jdelvare@suse.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/CodingStyle')
-rw-r--r--Documentation/CodingStyle7
1 files changed, 2 insertions, 5 deletions
diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 852253c932fe..9c61c039ccd9 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -451,9 +451,6 @@ Avoid using GW-BASIC names like ``err1:`` and ``err2:``, as you would have to
451renumber them if you ever add or remove exit paths, and they make correctness 451renumber them if you ever add or remove exit paths, and they make correctness
452difficult to verify anyway. 452difficult to verify anyway.
453 453
454It is advised to indent labels with a single space (not tab), so that
455``diff -p`` does not confuse labels with functions.
456
457The rationale for using gotos is: 454The rationale for using gotos is:
458 455
459- unconditional statements are easier to understand and follow 456- unconditional statements are easier to understand and follow
@@ -481,7 +478,7 @@ The rationale for using gotos is:
481 goto out_buffer; 478 goto out_buffer;
482 } 479 }
483 ... 480 ...
484 out_free_buffer: 481 out_free_buffer:
485 kfree(buffer); 482 kfree(buffer);
486 return result; 483 return result;
487 } 484 }
@@ -490,7 +487,7 @@ A common type of bug to be aware of is ``one err bugs`` which look like this:
490 487
491.. code-block:: c 488.. code-block:: c
492 489
493 err: 490 err:
494 kfree(foo->bar); 491 kfree(foo->bar);
495 kfree(foo); 492 kfree(foo);
496 return ret; 493 return ret;