lkml.org 
[lkml]   [2007]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectCodingStyle: mention bitfields/whitespace style, prefer (!foo) in examples

Mention whitespace and bitfields style, prefer (!foo) to (foo == NULL)
in examples.

Signed-off-by: Pavel Machek <pavel@suse.cz>

diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 7f1730f..1595a45 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -71,6 +71,15 @@ used for indentation, and the above exam

Get a decent editor and don't leave whitespace at the end of lines.

+Bitfield variables should be indented like this:
+
+ unsigned int foo :1;
+
+Do not put whitespace between any of the unary operators and their operand.
+
+It is usually unnecessary to have whitespace around parentheses as
+part of expressions, around brackets, or around the operators . and
+->.

Chapter 2: Breaking long lines and strings

@@ -403,7 +412,7 @@ int fun(int a)
int result = 0;
char *buffer = kmalloc(SIZE);

- if (buffer == NULL)
+ if (!buffer)
return -ENOMEM;

if (condition1) {
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-10-04 11:49    [W:0.043 / U:0.564 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site