Skip to contentSkip to conversation

docs: Remove space-before-label guidance from CodingStyle

PATCH In review Jonathan Corbet 3 participants 3 messages Sep 21, 2016 – Sep 22, 2016 Documentation

lore
Share & tools
lore

Jonathan Corbet

author maintainer
#0 lore raw

PATCH 1/1 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).

---
 Documentation/CodingStyle | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
Documentation/CodingStyle +0 -0
index 852253c932fe..9c61c039ccd9 100644
@@ -451,9 +451,6 @@ Avoid using GW-BASIC names like ``err1:`` and

``err2:``, as you would have to renumber them if you ever add or remove exit paths, and they make correctness difficult to verify anyway.

-It is advised to indent labels with a single space (not tab), so that -``diff -p`` does not confuse labels with functions.
-
The rationale for using gotos is:

- unconditional statements are easier to understand and follow
@@ -481,7 +478,7 @@ The rationale for using gotos is:
goto out_buffer;
}
...
- out_free_buffer:
+ out_free_buffer:
kfree(buffer);
return result;
}
@@ -490,7 +487,7 @@ A common type of bug to be aware of is ``one err bugs`` which look like this:
.. code-block:: c

- err:
+ err:
kfree(foo->bar);
kfree(foo);
return ret;

Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · Jonathan Corbet

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.

Thanks. I believe it's better to remove this one too.

#2 lore raw
In reply to Jonathan Corbet

Hi Jonathan,

Quoted 20 lines · Jonathan Corbet

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).
(...)

(quoted diff) +1 -1
@@ -481,7 +478,7 @@ The rationale for using gotos is:
 			goto out_buffer;
 		}
...
-	 out_free_buffer:
+	out_free_buffer:
 		kfree(buffer);
 		return result;
 	}
@@ -490,7 +487,7 @@ A common type of bug to be aware of is ``one err

bugs`` which look like this:
.. code-block:: c

Review

Quoted 5 lines
(quoted diff) +1 -1
-	 err:
+	err:
 		kfree(foo->bar);
 		kfree(foo);
 		return ret;

There are 2 more occurrences after this point, which you probably want to change too.

Signature · 2 lines
Jean Delvare
SUSE L3 Support