[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <29C1DC0826876849BDD9F1C67ABA294392B103@ala-mail09.corp.ad.wrs.com>
Date: Wed, 16 Apr 2008 07:06:21 -0700
From: "Stephens, Allan" <allan.stephens@...driver.com>
To: "David Miller" <davem@...emloft.net>
Cc: <netdev@...r.kernel.org>
Subject: RE: [PATCH 1/7 net-2.6.26] [TIPC]: Remove inlining of reference table locking routines
Hi David:
Thanks for your clarifications on style/conventions ... all good points.
Does your preference for use of the "!ptr" style also apply to
non-pointer variables? (For example, do you also prefer to see "!count"
rather than "count == 0"?) I'm asking because I've received conflicting
guidance in the past (not from you, of course), which gave me the
impression that the "ptr == NULL" form was the way the Linux kernel
gatekeepers wanted to see things done.
Regards,
Al
-----Original Message-----
From: David Miller [mailto:davem@...emloft.net]
Sent: Tuesday, April 15, 2008 10:00 PM
To: Stephens, Allan
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 1/7 net-2.6.26] [TIPC]: Remove inlining of reference
table locking routines
From: Allan Stephens <allan.stephens@...driver.com>
Date: Tue, 15 Apr 2008 15:43:51 -0400
> @@ -104,7 +135,7 @@ int tipc_ref_table_init(u32 requested_size, u32
> start)
>
> void tipc_ref_table_stop(void)
> {
> - if (!tipc_ref_table.entries)
> + if (unlikely(tipc_ref_table.entries == NULL))
> return;
Please don't mix gratuitous coding style changes with functional
changes. It makes auditing and review harder.
And in this case I prefer the more concise "!ptr".
It also could be argued that this isn't a fast path and thus the
likely/unlikely tags are not only unnecessary, but also likely to result
in code bloat for no real gain.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists