[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427650577.2715.32.camel@perches.com>
Date: Sun, 29 Mar 2015 10:36:17 -0700
From: Joe Perches <joe@...ches.com>
To: Ian Morris <ipm@...rality.org.uk>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next 0/2] ipv6: coding style - comparisons with NULL
On Sun, 2015-03-29 at 14:00 +0100, Ian Morris wrote:
> The IPV6 code uses multiple different styles when comparing with NULL
> (I.e. x == NULL and !x as well as x != NULL and x). Generally the
> latter form is preferred according to checkpatch and so this changes
> aligns the code to this style.
Hello Ian.
While I prefer this style, it can be a "maintainer's choice"
preference and this might be a bit contentious to some.
It might be nice to show the relative counts of each form
before this change to show the relative counts use of each
form to help establish consensus for the value for this patch.
(Or David could just apply it instead:)
Using coccinelle to check for pointer comparisons with and
without NULL for net/ipv6/*.[ch]:
with NULL: 260
without NULL: 779
So there was a 3:1 preference for the bare form.
(and for net/ipv4/*.[ch] it's closer to 4:1)
with NULL: 276
without NULL: 914
(trivial cocci script below)
@@
type A;
A *b;
@@
* b == NULL
@@
type A;
A *b;
@@
* b != NULL
--
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