login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
February
»
4
Re: CodingStyle: provide good example
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From:
Andrew Morton <akpm@...>
To: Pavel Machek <pavel@...>
Cc: <linux-kernel@...>
Subject:
Re: CodingStyle: provide good example
Date: Monday, February 4, 2008 - 7:51 pm
On Tue, 5 Feb 2008 00:43:43 +0100 Pavel Machek <pavel@ucw.cz> wrote:
quoted text
> 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) {
I tend to avoid preferring one over the other unless the extra seven columns is needed to prevent wraparound nasties. --
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
CodingStyle: provide good example
, Pavel Machek
, (Mon Feb 4, 7:43 pm)
Re: CodingStyle: provide good example
, Jan Engelhardt
, (Mon Feb 4, 8:21 pm)
Re: CodingStyle: provide good example
, Andrew Morton
, (Mon Feb 4, 7:51 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO
Andrew Morton
2.6.25-mm1
david
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Bart Van Assche
Integration of SCST in the mainstream Linux kernel
git
:
linux-netdev
:
Jarek Poplawski
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 15/37] dccp: Set per-connection CCIDs via socket options
David Miller
[GIT]: Networking
Natalie Protasevich
[BUG] New Kernel Bugs
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
1 user
and
505 guests
online.
Online users
strcmp
Syndicate