CodingStyle: provide good example
if (!buffer) is actually prefered style, so lets use it in example.
Pavel
Signed-off-by Pavel Machek <[email protected]>
Documentation/CodingStyle +1 -1
@@ -406,7 +415,7 @@ int fun(int a) int result = 0; char *buffer = kmalloc(SIZE); - if (buffer == NULL) + if (!buffer) return -ENOMEM; if (condition1) {
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 11 lines · On Tue, 5 Feb 2008 00:43:43 +0100 Pavel Machek <[email protected]> wrote:
if (!buffer) is actually prefered style, so lets use it in example.
Pavel
Signed-off-by Pavel Machek <[email protected]>Documentation/CodingStyle +0
-0
Documentation/CodingStyle int fun(int a) · line 421
Quoted 8 lines
Documentation/CodingStyle +1
-1@@ -406,7 +415,7 @@ int fun(int a) int result = 0; char *buffer = kmalloc(SIZE); - if (buffer == NULL) + if (!buffer) return -ENOMEM; if (condition1) {
I tend to avoid preferring one over the other unless the extra seven columns is needed to prevent wraparound nasties.
Quoted 3 lines · Pavel Machek
Subject: CodingStyle: provide good example
if (!buffer) is actually prefered style, so lets use it in example.
Just because it is "preferred" by some does not mean it is bad. I vote for diversity!