mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* CodingStyle: provide good example
@ 2008-02-04 23:43 Pavel Machek
  2008-02-04 23:51 ` Andrew Morton
  2008-02-05  0:21 ` Jan Engelhardt
  0 siblings, 2 replies; 3+ messages in thread
From: Pavel Machek @ 2008-02-04 23:43 UTC (permalink / raw)
  To: Andrew Morton, kernel list

if (!buffer) is actually prefered style, so lets use it in example.

								Pavel

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

diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index 6caa146..9bb2d8a 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -406,7 +415,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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-05  0:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-04 23:43 CodingStyle: provide good example Pavel Machek
2008-02-04 23:51 ` Andrew Morton
2008-02-05  0:21 ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®