Update coding style. Add error handling section
authorDavid Goulet <dgoulet@efficios.com>
Wed, 12 Sep 2012 19:26:46 +0000 (15:26 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 12 Sep 2012 19:26:46 +0000 (15:26 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
CodingStyle

index 6e7adfc4e9dcd7d9a5a1397d41d969d66e970752..77fa90c733be38f090d937d05950ffc47ef29122 100644 (file)
@@ -14,11 +14,32 @@ single-line if/else statements. Please refer to:
 - Linux kernel scripts/checkpatch.pl for a script which verify the patch
   coding style.
 
 - Linux kernel scripts/checkpatch.pl for a script which verify the patch
   coding style.
 
+Error handling:
+-------------
+
+We ask to use one single return point in a function. For that, we uses the
+"goto" statement for the error handling creating one single point for error
+handling and return code. See the following example:
+
+int some_function(...)
+{
+       int ret;
+       [...]
+
+       if (ret != 0) {
+               goto error;
+       }
+
+       [...]
+error:
+       return ret;
+}
+
 Commenting:
 -------------
 
 Every function MUST have a comment above it even if the function is trivial.
 
 Commenting:
 -------------
 
 Every function MUST have a comment above it even if the function is trivial.
 
-Please add non-trivial comments/documentation as much you can in the code. Poor
-comments WILL be rejected upon merging so please pay attention to this details
-because we do!
+Please add non-trivial comments/documentation as much as you can in the code.
+Poor comments WILL be rejected upon merging so please pay attention to this
+details because we do!
This page took 0.025314 seconds and 4 git commands to generate.